createRegistry method

Future<CreateRegistryResponse> createRegistry({
  1. required String name,
  2. ApprovalConfiguration? approvalConfiguration,
  3. String? clientToken,
  4. String? description,
  5. DiscoveryConfiguration? discoveryConfiguration,
  6. Map<String, String>? tags,
})

Creates a new registry, a catalog that organizes registry records and defines their discovery authorization and record approval behavior. Creation is asynchronous: the registry begins in the CREATING status and becomes usable once it reaches READY.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter name : The name of the registry

Parameter approvalConfiguration : Approval configuration for registry records

Parameter clientToken : Client token for idempotency

Parameter description : The description of the registry

Parameter discoveryConfiguration : Discovery configuration for the registry

Parameter tags : Tags to associate with the registry

Implementation

Future<CreateRegistryResponse> createRegistry({
  required String name,
  ApprovalConfiguration? approvalConfiguration,
  String? clientToken,
  String? description,
  DiscoveryConfiguration? discoveryConfiguration,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'name': name,
    if (approvalConfiguration != null)
      'approvalConfiguration': approvalConfiguration,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (discoveryConfiguration != null)
      'discoveryConfiguration': discoveryConfiguration,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/registries',
    exceptionFnMap: _exceptionFns,
  );
  return CreateRegistryResponse.fromJson(response);
}