# DeleteObject

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Unknown

Source code: <https://github.com/FrendsPlatform/Frends.AmazonS3>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Objects : `S3ObjectArray[]`                 | <p>Array of S3 objects to be deleted. Each object contains bucket name, key, and optional version ID.</p><p><br>Default: <code>-</code><br>Example: <code>\[ { BucketName: "ExampleBucket", Key: "ExampleKey", VersionId: "1" }, { BucketName: "ExampleBucket", Key: "ExampleKey2", VersionId: "" } ]</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ActionOnObjectNotFound : `NotExistsHandler` | <p>Defines how to handle objects that don't exist:</p><p>- None (Default): Task doesn't check if the object exists before deletion. Each delete operation will return version ID and be included in DeletedObjects unless an exception occurs.</p><p>- Info: Task will check if the object exists before each delete operation. Non-existing objects will be skipped and included in DeletedObjects with null version ID.</p><p>- Throw: Throw an exception if any object doesn't exist. Task will check all objects in Input.Objects before starting the delete process.</p><p>Possible values:</p><ul><li><code>None</code>:</li></ul><p>Defines how to handle objects that don't exist:</p><p>- None (Default): Task doesn't check if the object exists before deletion. Each delete operation will return version ID and be included in DeletedObjects unless an exception occurs.</p><p>- Info: Task will check if the object exists before each delete operation. Non-existing objects will be skipped and included in DeletedObjects with null version ID.</p><p>- Throw: Throw an exception if any object doesn't exist. Task will check all objects in Input.Objects before starting the delete process.</p><ul><li><code>Info</code>:</li></ul><p>Defines how to handle objects that don't exist:</p><p>- None (Default): Task doesn't check if the object exists before deletion. Each delete operation will return version ID and be included in DeletedObjects unless an exception occurs.</p><p>- Info: Task will check if the object exists before each delete operation. Non-existing objects will be skipped and included in DeletedObjects with null version ID.</p><p>- Throw: Throw an exception if any object doesn't exist. Task will check all objects in Input.Objects before starting the delete process.</p><ul><li><code>Throw</code>:</li></ul><p>Defines how to handle objects that don't exist:</p><p>- None (Default): Task doesn't check if the object exists before deletion. Each delete operation will return version ID and be included in DeletedObjects unless an exception occurs.</p><p>- Info: Task will check if the object exists before each delete operation. Non-existing objects will be skipped and included in DeletedObjects with null version ID.</p><p>- Throw: Throw an exception if any object doesn't exist. Task will check all objects in Input.Objects before starting the delete process.</p><p><br>Default: <code>0</code><br>Example: <code>NotExistsHandler.None</code></p> |
| {% endtab %}                                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

{% tab title="Parameter: Connection" %}

| Name                            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 🗝AwsAccessKeyId : `String`     | <p>AWS Access Key ID for authentication with AWS S3 service.</p><p><br>Default: <code>-</code><br>Example: <code>AKIAQWERTY7NJ5Q7NZ6Q</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| 🗝AwsSecretAccessKey : `String` | <p>AWS Secret Access Key for authentication with AWS S3 service.</p><p><br>Default: <code>-</code><br>Example: <code>TVh5hgd3uGY/2CqH</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Region : `Region`               | <p>The AWS region where the S3 bucket is located.</p><p>Possible values:</p><ul><li><code>AfSouth1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>ApEast1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>ApNortheast1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>ApNortheast2</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>ApNortheast3</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>ApSouth1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>ApSoutheast1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>ApSoutheast2</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>CaCentral1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>CnNorth1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>CnNorthWest1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>EuCentral1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>EuNorth1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>EuSouth1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>EuWest1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>EuWest2</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>EuWest3</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>MeSouth1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>SaEast1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>UsEast1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>UsEast2</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>UsWest1</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><ul><li><code>UsWest2</code>:</li></ul><p>The AWS region where the S3 bucket is located.</p><p><br>Default: <code>14</code><br>Example: <code>Region.EuCentral1</code></p> |
| {% endtab %}                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

{% tab title="Parameter: Options" %}

| Name                             | Description                                                                                                                                                                                         |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Timeout : `Int32`                | <p>Timeout in seconds for S3 operations. If an operation takes longer than this value, it will be cancelled.</p><p><br>Default: <code>30</code><br>Example: <code>30</code></p>                     |
| ThrowErrorOnFailure : `Boolean`  | <p>If true, throws an exception when any delete operation fails. If false, returns a Result object with error information.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>   |
| ErrorMessageOnFailure : `String` | <p>Custom error message to use when operations fail. If empty, default error messages will be used.</p><p><br>Default: <code>-</code><br>Example: <code>"Custom delete operation failed"</code></p> |
| {% endtab %}                     |                                                                                                                                                                                                     |

{% tab title="Result: Result" %}

| Name                                        | Description                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success : `Boolean`                         | <p>Indicates whether all delete operations completed successfully. False if any operations failed or objects were not found (depending on ActionOnObjectNotFound setting).<br>Example: <code>true</code></p>                                                                                                                                                                                                  |
| DeletedObjects : `List<SingleResultObject>` | <p>List of objects that were processed during the delete operation. Includes both successfully deleted objects and skipped objects (when ActionOnObjectNotFound is set to Info).<br>Example: <code>\[ { BucketName: "my-bucket", Key: "Key1.txt", VersionId: "etZwWf8lJPf\_5MuzOyFzepWqA3eS3EIN" }, { BucketName: "my-bucket", Key: "Key2.txt", VersionId: "atZwWf8lJPf\_5MuzOyFzepWqA3eS3EIN" } ]</code></p> |
| Error : `Error`                             | <p>Error information containing details about failed operations and objects that encountered errors. Null if all operations succeeded.<br>Example: <code>{ Message: "Some objects could not be deleted.", AdditionalInfo: \[ { BucketName: "my-bucket", Key: "Key3.txt", VersionId: null } ] }</code></p>                                                                                                     |
| {% endtab %}                                |                                                                                                                                                                                                                                                                                                                                                                                                               |

{% tab title="Changelog" %}

## Changelog

### \[2.0.0] - 2026-01-07

#### Added

* New Connection tab with AWS connection parameters (AwsAccessKeyId, AwsSecretAccessKey, Region)
* ThrowErrorOnFailure option in Options tab with default value true
* ErrorMessageOnFailure option in Options tab for custom error messages
* BucketName property in SingleResultObject class
* Error class with Message and AdditionalInfo properties

#### Changed

* \[Breaking] Moved AwsAccessKeyId, AwsSecretAccessKey, and Region from Input tab to Connection tab
* \[Breaking] Moved NotExistsHandler from Options tab to Input tab and renamed to ActionOnObjectNotFound
* \[Breaking] Renamed Result.Data property to Result.DeletedObjects
* \[Breaking] Removed Success and Error properties from SingleResultObject class
* \[Breaking] Updated Result class structure with new Error property

### \[1.0.0] - 2023-02-20

#### Added

* Initial implementation
  {% endtab %}
  {% endtabs %}
