Skip to content

associate_data_share_consumer async

associate_data_share_consumer(
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    data_share_arn: Optional[String] = None,
    associate_entire_account: Optional[BooleanOptional] = None,
    consumer_arn: Optional[String] = None,
    consumer_region: Optional[String] = None,
    allow_writes: Optional[BooleanOptional] = None,
) -> DataShare

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.

Parameters:

  • data_share_arn (Optional[String], default: None ) –

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

  • associate_entire_account (Optional[BooleanOptional], default: None ) –

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

  • consumer_arn (Optional[String], default: None ) –

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

  • consumer_region (Optional[String], default: None ) –

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

  • allow_writes (Optional[BooleanOptional], default: None ) –

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

Raises:

Source code in docs_src/capo_redshift/_services/async_redshift.py
async def associate_data_share_consumer(
    self,
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    data_share_arn: Optional["capo_redshift.types.string.String"] = None,
    associate_entire_account: Optional[
        "capo_redshift.types.boolean_optional.BooleanOptional"
    ] = None,
    consumer_arn: Optional["capo_redshift.types.string.String"] = None,
    consumer_region: Optional["capo_redshift.types.string.String"] = None,
    allow_writes: Optional[
        "capo_redshift.types.boolean_optional.BooleanOptional"
    ] = None,
) -> "capo_redshift.types.data_share.DataShare":
    """<p>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.</p>

    Args:
        data_share_arn: <p>The Amazon Resource Name (ARN) of the datashare that the consumer is to use.</p>
        associate_entire_account: <p>A value that specifies whether the datashare is associated with the entire account.</p>
        consumer_arn: <p>The Amazon Resource Name (ARN) of the consumer namespace associated with the datashare.</p>
        consumer_region: <p>From a datashare consumer account, associates a datashare with all existing and future namespaces in the specified Amazon Web Services Region.</p>
        allow_writes: <p>If set to true, allows write operations for a datashare.</p>

    Raises:
        capo_redshift.errors.invalid_data_share_fault.InvalidDataShareFault: <p>There is an error with the datashare.</p>
        capo_redshift.errors.invalid_namespace_fault.InvalidNamespaceFault: <p>The namespace isn't valid because the namespace doesn't exist. Provide a valid namespace.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_redshift.types.associate_data_share_consumer_message.AssociateDataShareConsumerMessage]",
    ) -> AsyncOperationResponse["capo_redshift.types.data_share.DataShare"]:
        import capo_redshift._operations.redshift_service_version20121201.associate_data_share_consumer

        (
            output,
            http_response,
        ) = await capo_redshift._operations.redshift_service_version20121201.associate_data_share_consumer.async_associate_data_share_consumer(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociateDataShareConsumer")
    )
    input_: capo_redshift.types.associate_data_share_consumer_message.AssociateDataShareConsumerMessage = {}
    if data_share_arn is not None:
        input_["data_share_arn"] = data_share_arn
    if associate_entire_account is not None:
        input_["associate_entire_account"] = associate_entire_account
    if consumer_arn is not None:
        input_["consumer_arn"] = consumer_arn
    if consumer_region is not None:
        input_["consumer_region"] = consumer_region
    if allow_writes is not None:
        input_["allow_writes"] = allow_writes

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output