applySchema method

Future<ApplySchemaResponse> applySchema({
  1. required String directoryArn,
  2. required String publishedSchemaArn,
})

Copies the input published schema, at the specified version, into the Directory with the same name and version as that of the published schema.

May throw InternalServiceException. May throw InvalidArnException. May throw RetryableConflictException. May throw ValidationException. May throw LimitExceededException. May throw AccessDeniedException. May throw ResourceNotFoundException. May throw InvalidAttachmentException.

Parameter directoryArn : The Amazon Resource Name (ARN) that is associated with the Directory into which the schema is copied. For more information, see arns.

Parameter publishedSchemaArn : Published schema Amazon Resource Name (ARN) that needs to be copied. For more information, see arns.

Implementation

Future<ApplySchemaResponse> applySchema({
  required String directoryArn,
  required String publishedSchemaArn,
}) async {
  ArgumentError.checkNotNull(directoryArn, 'directoryArn');
  ArgumentError.checkNotNull(publishedSchemaArn, 'publishedSchemaArn');
  final headers = <String, String>{
    'x-amz-data-partition': directoryArn.toString(),
  };
  final $payload = <String, dynamic>{
    'PublishedSchemaArn': publishedSchemaArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/amazonclouddirectory/2017-01-11/schema/apply',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return ApplySchemaResponse.fromJson(response);
}