registerNamespace method

Future<RegisterNamespaceOutputMessage> registerNamespace({
  1. required List<String> consumerIdentifiers,
  2. required NamespaceIdentifierUnion namespaceIdentifier,
})

Registers a cluster or serverless namespace to the Amazon Web Services Glue Data Catalog.

May throw ClusterNotFoundFault. May throw InvalidClusterStateFault. May throw InvalidNamespaceFault.

Parameter consumerIdentifiers : An array containing the ID of the consumer account that you want to register the namespace to.

Parameter namespaceIdentifier : The unique identifier of the cluster or serverless namespace that you want to register.

Implementation

Future<RegisterNamespaceOutputMessage> registerNamespace({
  required List<String> consumerIdentifiers,
  required NamespaceIdentifierUnion namespaceIdentifier,
}) async {
  final $request = <String, String>{
    if (consumerIdentifiers.isEmpty)
      'ConsumerIdentifiers': ''
    else
      for (var i1 = 0; i1 < consumerIdentifiers.length; i1++)
        'ConsumerIdentifiers.member.${i1 + 1}': consumerIdentifiers[i1],
    for (var e1 in namespaceIdentifier.toQueryMap().entries)
      'NamespaceIdentifier.${e1.key}': e1.value,
  };
  final $result = await _protocol.send(
    $request,
    action: 'RegisterNamespace',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'RegisterNamespaceResult',
  );
  return RegisterNamespaceOutputMessage.fromXml($result);
}