putVectorBucketPolicy method

Future<void> putVectorBucketPolicy({
  1. required String policy,
  2. String? vectorBucketArn,
  3. String? vectorBucketName,
})

Creates a bucket policy for a vector bucket. To specify the bucket, you must use either the vector bucket name or the vector bucket Amazon Resource Name (ARN).

Permissions
You must have the s3vectors:PutVectorBucketPolicy permission to use this operation.

May throw NotFoundException. May throw ServiceUnavailableException.

Parameter policy : The JSON that defines the policy. For more information about bucket policies for S3 Vectors, see Managing vector bucket policies in the Amazon S3 User Guide.

Parameter vectorBucketArn : The Amazon Resource Name (ARN) of the vector bucket.

Parameter vectorBucketName : The name of the vector bucket.

Implementation

Future<void> putVectorBucketPolicy({
  required String policy,
  String? vectorBucketArn,
  String? vectorBucketName,
}) async {
  final $payload = <String, dynamic>{
    'policy': policy,
    if (vectorBucketArn != null) 'vectorBucketArn': vectorBucketArn,
    if (vectorBucketName != null) 'vectorBucketName': vectorBucketName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/PutVectorBucketPolicy',
    exceptionFnMap: _exceptionFns,
  );
}