Skip to content

create_account_association

create_account_association(
    connector_destination_id: ConnectorDestinationId,
    *,
    config_overrides: Optional[IoTManagedIntegrationsClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    name: Optional[AccountAssociationName] = None,
    description: Optional[AccountAssociationDescription] = None,
    tags: Optional[TagsMap] = None,
    general_authorization: Optional[GeneralAuthorizationName] = None,
) -> CreateAccountAssociationResponse

Creates a new account association via the destination id.

Parameters:

  • client_token (Optional[ClientToken], default: None ) –

    An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.

  • connector_destination_id (ConnectorDestinationId) –

    The identifier of the connector destination.

  • name (Optional[AccountAssociationName], default: None ) –

    The name of the destination for the new account association.

  • description (Optional[AccountAssociationDescription], default: None ) –

    A description of the account association request.

  • tags (Optional[TagsMap], default: None ) –

    A set of key/value pairs that are used to manage the account association.

  • general_authorization (Optional[GeneralAuthorizationName], default: None ) –

    The General Authorization reference by authorization material name.

Raises:

Source code in docs_src/capo_iot_managed_integrations/_services/io_t_managed_integrations.py
def create_account_association(
    self,
    connector_destination_id: "capo_iot_managed_integrations.types.connector_destination_id.ConnectorDestinationId",
    *,
    config_overrides: Optional[IoTManagedIntegrationsClientConfig] = None,
    client_token: Optional[
        "capo_iot_managed_integrations.types.client_token.ClientToken"
    ] = None,
    name: Optional[
        "capo_iot_managed_integrations.types.account_association_name.AccountAssociationName"
    ] = None,
    description: Optional[
        "capo_iot_managed_integrations.types.account_association_description.AccountAssociationDescription"
    ] = None,
    tags: Optional["capo_iot_managed_integrations.types.tags_map.TagsMap"] = None,
    general_authorization: Optional[
        "capo_iot_managed_integrations.types.general_authorization_name.GeneralAuthorizationName"
    ] = None,
) -> "capo_iot_managed_integrations.types.create_account_association_response.CreateAccountAssociationResponse":
    """<p>Creates a new account association via the destination id.</p>

    Args:
        client_token: <p>An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.</p>
        connector_destination_id: <p>The identifier of the connector destination.</p>
        name: <p>The name of the destination for the new account association.</p>
        description: <p>A description of the account association request.</p>
        tags: <p>A set of key/value pairs that are used to manage the account association.</p>
        general_authorization: <p>The General Authorization reference by authorization material name.</p>

    Raises:
        capo_iot_managed_integrations.errors.access_denied_exception.AccessDeniedException: <p>User is not authorized.</p>
        capo_iot_managed_integrations.errors.conflict_exception.ConflictException: <p>There is a conflict with the request.</p>
        capo_iot_managed_integrations.errors.internal_server_exception.InternalServerException: <p>Internal error from the service that indicates an unexpected error or that the service is unavailable.</p>
        capo_iot_managed_integrations.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_iot_managed_integrations.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
        capo_iot_managed_integrations.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot_managed_integrations.errors.unauthorized_exception.UnauthorizedException: <p>You are not authorized to perform this operation.</p>
        capo_iot_managed_integrations.errors.validation_exception.ValidationException: <p>A validation error occurred when performing the API request.</p>
        capo_iot_managed_integrations.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot_managed_integrations.types.create_account_association_request.CreateAccountAssociationRequest]",
    ) -> OperationResponse[
        "capo_iot_managed_integrations.types.create_account_association_response.CreateAccountAssociationResponse"
    ]:
        import capo_iot_managed_integrations._operations.iot_managed_integrations.create_account_association

        output, http_response = (
            capo_iot_managed_integrations._operations.iot_managed_integrations.create_account_association.create_account_association(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_iot_managed_integrations.types.create_account_association_request.CreateAccountAssociationRequest",
    ) -> dict[str, Any]:
        import capo_iot_managed_integrations.types.create_account_association_request

        return capo_iot_managed_integrations.types.create_account_association_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_iot_managed_integrations.types.create_account_association_response.CreateAccountAssociationResponse",
    ) -> dict[str, Any]:
        import capo_iot_managed_integrations.types.create_account_association_response

        return capo_iot_managed_integrations.types.create_account_association_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateAccountAssociation",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_iot_managed_integrations.types.create_account_association_request.CreateAccountAssociationRequest = {
        "connector_destination_id": connector_destination_id
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags
    if general_authorization is not None:
        input_["general_authorization"] = general_authorization

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output