associateDataShareConsumer method

Future<DataShare> associateDataShareConsumer({
  1. required String dataShareArn,
  2. bool? allowWrites,
  3. bool? associateEntireAccount,
  4. String? consumerArn,
  5. String? consumerRegion,
})

From a datashare consumer account, associates a datashare with the account (AssociateEntireAccount) or the specified namespace (ConsumerArn). If you make this association, the consumer can consume the datashare.

May throw InvalidDataShareFault. May throw InvalidNamespaceFault.

Parameter dataShareArn : The Amazon Resource Name (ARN) of the datashare that the consumer is to use.

Parameter allowWrites : If set to true, allows write operations for a datashare.

Parameter associateEntireAccount : A value that specifies whether the datashare is associated with the entire account.

Parameter consumerArn : The Amazon Resource Name (ARN) of the consumer namespace associated with the datashare.

Parameter consumerRegion : From a datashare consumer account, associates a datashare with all existing and future namespaces in the specified Amazon Web Services Region.

Implementation

Future<DataShare> associateDataShareConsumer({
  required String dataShareArn,
  bool? allowWrites,
  bool? associateEntireAccount,
  String? consumerArn,
  String? consumerRegion,
}) async {
  final $request = <String, String>{
    'DataShareArn': dataShareArn,
    if (allowWrites != null) 'AllowWrites': allowWrites.toString(),
    if (associateEntireAccount != null)
      'AssociateEntireAccount': associateEntireAccount.toString(),
    if (consumerArn != null) 'ConsumerArn': consumerArn,
    if (consumerRegion != null) 'ConsumerRegion': consumerRegion,
  };
  final $result = await _protocol.send(
    $request,
    action: 'AssociateDataShareConsumer',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'AssociateDataShareConsumerResult',
  );
  return DataShare.fromXml($result);
}