Skip to content

Commit

Permalink
chore: add copy example for expected bucket owner
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanZhengYP committed Dec 2, 2024
1 parent 5b4b2c1 commit 7b1602a
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ const copyFile = async () => {
path: 'album/2024/1.jpg',
// Specify a target bucket using name assigned in Amplify Backend
// or bucket name from console and associated region
bucket: 'assignedNameInAmplifyBackend'
bucket: 'assignedNameInAmplifyBackend',
expectedBucketOwner: '123456789012'
},
destination: {
path: 'shared/2024/1.jpg',
Expand All @@ -95,7 +96,8 @@ const copyFile = async () => {
bucket: {
bucketName: 'generated-second-bucket-name',
region: 'us-east-2'
}
},
expectedBucketOwner: '123456789013'
}
});
} catch (error) {
Expand All @@ -116,7 +118,7 @@ Option | Type | Default | Description |
| bucket | string \| <br />\{ bucketName: string;<br/> region: string; \} | Default bucket and region from Amplify configuration | A string representing the target bucket's assigned name in Amplify Backend or an object specifying the bucket name and region from the console.<br/><br/>Read more at [Configure additional storage buckets](/[platform]/build-a-backend/storage/set-up-storage/#configure-additional-storage-buckets). |
| eTag | string | Optional | The copy **source object** entity tag (ETag) value. Only Copies the object if its ETag matches the specified tag. |
| notModifiedSince | Date | Optional | Copies the **source object** if it hasn't been modified since the specified time. <br /><br/> **This is evaluated only when `eTag` is NOT supplied**|
| expectedBucketOwner | string | Optional | The account ID that owns source or destination bucket. |
| expectedBucketOwner | string | Optional | `source.expectedBucketOwner`: The account ID that owns the source bucket. <br /><br /> `destination.expectedBucketOwner`: The account ID that owns the destination bucket. |

</InlineFilter>

Expand Down

0 comments on commit 7b1602a

Please sign in to comment.