authorizeSnapshotAccess method
Authorizes the specified AWS customer account to restore the specified snapshot.
For more information about working with snapshots, go to Amazon Redshift Snapshots in the Amazon Redshift Cluster Management Guide.
May throw ClusterSnapshotNotFoundFault. May throw AuthorizationAlreadyExistsFault. May throw AuthorizationQuotaExceededFault. May throw DependentServiceRequestThrottlingFault. May throw InvalidClusterSnapshotStateFault. May throw LimitExceededFault.
Parameter accountWithRestoreAccess
:
The identifier of the AWS customer account authorized to restore the
specified snapshot.
To share a snapshot with AWS support, specify amazon-redshift-support.
Parameter snapshotIdentifier
:
The identifier of the snapshot the account is authorized to restore.
Parameter snapshotClusterIdentifier
:
The identifier of the cluster the snapshot was created from. This
parameter is required if your IAM user has a policy containing a snapshot
resource element that specifies anything other than * for the cluster
name.
Implementation
Future<AuthorizeSnapshotAccessResult> authorizeSnapshotAccess({
required String accountWithRestoreAccess,
required String snapshotIdentifier,
String? snapshotClusterIdentifier,
}) async {
ArgumentError.checkNotNull(
accountWithRestoreAccess, 'accountWithRestoreAccess');
_s.validateStringLength(
'accountWithRestoreAccess',
accountWithRestoreAccess,
0,
2147483647,
isRequired: true,
);
ArgumentError.checkNotNull(snapshotIdentifier, 'snapshotIdentifier');
_s.validateStringLength(
'snapshotIdentifier',
snapshotIdentifier,
0,
2147483647,
isRequired: true,
);
_s.validateStringLength(
'snapshotClusterIdentifier',
snapshotClusterIdentifier,
0,
2147483647,
);
final $request = <String, dynamic>{};
$request['AccountWithRestoreAccess'] = accountWithRestoreAccess;
$request['SnapshotIdentifier'] = snapshotIdentifier;
snapshotClusterIdentifier
?.also((arg) => $request['SnapshotClusterIdentifier'] = arg);
final $result = await _protocol.send(
$request,
action: 'AuthorizeSnapshotAccess',
version: '2012-12-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['AuthorizeSnapshotAccessMessage'],
shapes: shapes,
resultWrapper: 'AuthorizeSnapshotAccessResult',
);
return AuthorizeSnapshotAccessResult.fromXml($result);
}