createRegistry method

Future<CreateRegistryResponse> createRegistry({
  1. required String registryName,
  2. String? description,
  3. Map<String, String>? tags,
})

Creates a new registry which may be used to hold a collection of schemas.

May throw InvalidInputException. May throw AccessDeniedException. May throw AlreadyExistsException. May throw ResourceNumberLimitExceededException. May throw InternalServiceException.

Parameter registryName : Name of the registry to be created of max length of 255, and may only contain letters, numbers, hyphen, underscore, dollar sign, or hash mark. No whitespace.

Parameter description : A description of the registry. If description is not provided, there will not be any default value for this.

Parameter tags : AWS tags that contain a key value pair and may be searched by console, command line, or API.

Implementation

Future<CreateRegistryResponse> createRegistry({
  required String registryName,
  String? description,
  Map<String, String>? tags,
}) async {
  ArgumentError.checkNotNull(registryName, 'registryName');
  _s.validateStringLength(
    'registryName',
    registryName,
    1,
    255,
    isRequired: true,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.CreateRegistry'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'RegistryName': registryName,
      if (description != null) 'Description': description,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateRegistryResponse.fromJson(jsonResponse.body);
}