putSchemaFromJson method

Future<PutSchemaFromJsonResponse> putSchemaFromJson({
  1. required String document,
  2. required String schemaArn,
})

Allows a schema to be updated using JSON upload. Only available for development schemas. See JSON Schema Format for more information.

May throw InternalServiceException. May throw InvalidArnException. May throw RetryableConflictException. May throw ValidationException. May throw LimitExceededException. May throw AccessDeniedException. May throw InvalidSchemaDocException. May throw InvalidRuleException.

Parameter document : The replacement JSON schema.

Parameter schemaArn : The ARN of the schema to update.

Implementation

Future<PutSchemaFromJsonResponse> putSchemaFromJson({
  required String document,
  required String schemaArn,
}) async {
  ArgumentError.checkNotNull(document, 'document');
  ArgumentError.checkNotNull(schemaArn, 'schemaArn');
  final headers = <String, String>{
    'x-amz-data-partition': schemaArn.toString(),
  };
  final $payload = <String, dynamic>{
    'Document': document,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/amazonclouddirectory/2017-01-11/schema/json',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return PutSchemaFromJsonResponse.fromJson(response);
}