Skip to content

associate_aws_account_with_partner_account

associate_aws_account_with_partner_account(
    sidewalk: SidewalkAccountInfo,
    *,
    config_overrides: Optional[IoTWirelessClientConfig] = None,
    client_request_token: Optional[ClientRequestToken] = None,
    tags: Optional[TagList] = None,
) -> AssociateAwsAccountWithPartnerAccountResponse

Associates a partner account with your AWS account.

Parameters:

  • sidewalk (SidewalkAccountInfo) –

    The Sidewalk account credentials.

  • client_request_token (Optional[ClientRequestToken], default: None ) –

    Each resource must have a unique client request token. The client token is used to implement idempotency. It ensures that the request completes no more than one time. If you retry a request with the same token and the same parameters, the request will complete successfully. However, if you try to create a new resource using the same token but different parameters, an HTTP 409 conflict occurs. If you omit this value, AWS SDKs will automatically generate a unique client request. For more information about idempotency, see Ensuring idempotency in Amazon EC2 API requests.

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

    The tags to attach to the specified resource. Tags are metadata that you can use to manage a resource.

Raises:

Source code in docs_src/capo_iot_wireless/_services/io_t_wireless.py
def associate_aws_account_with_partner_account(
    self,
    sidewalk: "capo_iot_wireless.types.sidewalk_account_info.SidewalkAccountInfo",
    *,
    config_overrides: Optional[IoTWirelessClientConfig] = None,
    client_request_token: Optional[
        "capo_iot_wireless.types.client_request_token.ClientRequestToken"
    ] = None,
    tags: Optional["capo_iot_wireless.types.tag_list.TagList"] = None,
) -> "capo_iot_wireless.types.associate_aws_account_with_partner_account_response.AssociateAwsAccountWithPartnerAccountResponse":
    """<p>Associates a partner account with your AWS account.</p>

    Args:
        sidewalk: <p>The Sidewalk account credentials.</p>
        client_request_token: <p>Each resource must have a unique client request token. The client token is used to implement idempotency. It ensures that the request completes no more than one time. If you retry a request with the same token and the same parameters, the request will complete successfully. However, if you try to create a new resource using the same token but different parameters, an HTTP 409 conflict occurs. If you omit this value, AWS SDKs will automatically generate a unique client request. For more information about idempotency, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a>.</p>
        tags: <p>The tags to attach to the specified resource. Tags are metadata that you can use to manage a resource.</p>

    Raises:
        capo_iot_wireless.errors.access_denied_exception.AccessDeniedException: <p>User does not have permission to perform this action.</p>
        capo_iot_wireless.errors.conflict_exception.ConflictException: <p>Adding, updating, or deleting the resource can cause an inconsistent state.</p>
        capo_iot_wireless.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred while processing a request.</p>
        capo_iot_wireless.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource does not exist.</p>
        capo_iot_wireless.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded the allowed API request rate.</p>
        capo_iot_wireless.errors.validation_exception.ValidationException: <p>The input did not meet the specified constraints.</p>
        capo_iot_wireless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot_wireless.types.associate_aws_account_with_partner_account_request.AssociateAwsAccountWithPartnerAccountRequest]",
    ) -> OperationResponse[
        "capo_iot_wireless.types.associate_aws_account_with_partner_account_response.AssociateAwsAccountWithPartnerAccountResponse"
    ]:
        import capo_iot_wireless._operations.iotwireless.associate_aws_account_with_partner_account

        output, http_response = (
            capo_iot_wireless._operations.iotwireless.associate_aws_account_with_partner_account.associate_aws_account_with_partner_account(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_iot_wireless.types.associate_aws_account_with_partner_account_request.AssociateAwsAccountWithPartnerAccountRequest",
    ) -> dict[str, Any]:
        import capo_iot_wireless.types.associate_aws_account_with_partner_account_request

        return capo_iot_wireless.types.associate_aws_account_with_partner_account_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_iot_wireless.types.associate_aws_account_with_partner_account_response.AssociateAwsAccountWithPartnerAccountResponse",
    ) -> dict[str, Any]:
        import capo_iot_wireless.types.associate_aws_account_with_partner_account_response

        return capo_iot_wireless.types.associate_aws_account_with_partner_account_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "AssociateAwsAccountWithPartnerAccount",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_iot_wireless.types.associate_aws_account_with_partner_account_request.AssociateAwsAccountWithPartnerAccountRequest = {
        "sidewalk": sidewalk
    }
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if tags is not None:
        input_["tags"] = tags

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