UNPKG

1.63 kBTypeScriptView Raw
1import { AmplifyServer } from '@aws-amplify/core/internals/adapter-core';
2import { CopyInput, CopyOutput, CopyWithPathInput, CopyWithPathOutput } from '../../types';
3/**
4 * Copy an object from a source to a destination object within the same bucket.
5 *
6 * @param contextSpec - The isolated server context.
7 * @param input - The `CopyWithPathInput` object.
8 * @returns Output containing the destination object path.
9 * @throws service: `S3Exception` - Thrown when checking for existence of the object
10 * @throws validation: `StorageValidationErrorCode` - Thrown when
11 * source or destination path is not defined.
12 */
13export declare function copy(contextSpec: AmplifyServer.ContextSpec, input: CopyWithPathInput): Promise<CopyWithPathOutput>;
14/**
15 * @deprecated The `key` and `accessLevel` parameters are deprecated and may be removed in the next major version.
16 * Please use {@link https://docs.amplify.aws/react/build-a-backend/storage/copy | path} instead.
17 *
18 * Copy an object from a source to a destination object within the same bucket. Can optionally copy files across
19 * different accessLevel or identityId (if source object's accessLevel is 'protected').
20 *
21 * @param contextSpec - The isolated server context.
22 * @param input - The `CopyInput` object.
23 * @returns Output containing the destination object key.
24 * @throws service: `S3Exception` - Thrown when checking for existence of the object
25 * @throws validation: `StorageValidationErrorCode` - Thrown when
26 * source or destination key is not defined.
27 */
28export declare function copy(contextSpec: AmplifyServer.ContextSpec, input: CopyInput): Promise<CopyOutput>;