Skip to content

add_thing_to_billing_group async

add_thing_to_billing_group(
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    billing_group_name: Optional[BillingGroupName] = None,
    billing_group_arn: Optional[BillingGroupArn] = None,
    thing_name: Optional[ThingName] = None,
    thing_arn: Optional[ThingArn] = None,
) -> AddThingToBillingGroupResponse

Adds a thing to a billing group.

Requires permission to access the AddThingToBillingGroup action.

Parameters:

  • billing_group_name (Optional[BillingGroupName], default: None ) –

    The name of the billing group.

    This call is asynchronous. It might take several seconds for the detachment to propagate.

  • billing_group_arn (Optional[BillingGroupArn], default: None ) –

    The ARN of the billing group.

  • thing_name (Optional[ThingName], default: None ) –

    The name of the thing to be added to the billing group.

  • thing_arn (Optional[ThingArn], default: None ) –

    The ARN of the thing to be added to the billing group.

Raises:

Source code in docs_src/capo_iot/_services/async_io_t.py
async def add_thing_to_billing_group(
    self,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    billing_group_name: Optional[
        "capo_iot.types.billing_group_name.BillingGroupName"
    ] = None,
    billing_group_arn: Optional[
        "capo_iot.types.billing_group_arn.BillingGroupArn"
    ] = None,
    thing_name: Optional["capo_iot.types.thing_name.ThingName"] = None,
    thing_arn: Optional["capo_iot.types.thing_arn.ThingArn"] = None,
) -> "capo_iot.types.add_thing_to_billing_group_response.AddThingToBillingGroupResponse":
    """<p>Adds a thing to a billing group.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">AddThingToBillingGroup</a> action.</p>

    Args:
        billing_group_name: <p>The name of the billing group.</p> <note> <p>This call is asynchronous. It might take several seconds for the detachment to propagate.</p> </note>
        billing_group_arn: <p>The ARN of the billing group.</p>
        thing_name: <p>The name of the thing to be added to the billing group.</p>
        thing_arn: <p>The ARN of the thing to be added to the billing group.</p>

    Raises:
        capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot.types.add_thing_to_billing_group_request.AddThingToBillingGroupRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot.types.add_thing_to_billing_group_response.AddThingToBillingGroupResponse"
    ]:
        import capo_iot._operations.aws_iot_service.add_thing_to_billing_group

        (
            output,
            http_response,
        ) = await capo_iot._operations.aws_iot_service.add_thing_to_billing_group.async_add_thing_to_billing_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AddThingToBillingGroup")
    )
    input_: capo_iot.types.add_thing_to_billing_group_request.AddThingToBillingGroupRequest = {}
    if billing_group_name is not None:
        input_["billing_group_name"] = billing_group_name
    if billing_group_arn is not None:
        input_["billing_group_arn"] = billing_group_arn
    if thing_name is not None:
        input_["thing_name"] = thing_name
    if thing_arn is not None:
        input_["thing_arn"] = thing_arn

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