publishSchema method

Future<PublishSchemaResponse> publishSchema({
  1. required String developmentSchemaArn,
  2. required String version,
  3. String? minorVersion,
  4. String? name,
})

Publishes a development schema with a major version and a recommended minor version.

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

Parameter developmentSchemaArn : The Amazon Resource Name (ARN) that is associated with the development schema. For more information, see arns.

Parameter version : The major version under which the schema will be published. Schemas have both a major and minor version associated with them.

Parameter minorVersion : The minor version under which the schema will be published. This parameter is recommended. Schemas have both a major and minor version associated with them.

Parameter name : The new name under which the schema will be published. If this is not provided, the development schema is considered.

Implementation

Future<PublishSchemaResponse> publishSchema({
  required String developmentSchemaArn,
  required String version,
  String? minorVersion,
  String? name,
}) async {
  ArgumentError.checkNotNull(developmentSchemaArn, 'developmentSchemaArn');
  ArgumentError.checkNotNull(version, 'version');
  _s.validateStringLength(
    'version',
    version,
    1,
    10,
    isRequired: true,
  );
  _s.validateStringLength(
    'minorVersion',
    minorVersion,
    1,
    10,
  );
  _s.validateStringLength(
    'name',
    name,
    1,
    32,
  );
  final headers = <String, String>{
    'x-amz-data-partition': developmentSchemaArn.toString(),
  };
  final $payload = <String, dynamic>{
    'Version': version,
    if (minorVersion != null) 'MinorVersion': minorVersion,
    if (name != null) 'Name': name,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/amazonclouddirectory/2017-01-11/schema/publish',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return PublishSchemaResponse.fromJson(response);
}