Creates a billing group. If this call is made multiple times using the same billing group name and configuration, the call will succeed. If this call is made with the same billing group name but different configuration a ResourceAlreadyExistsException is thrown.
Requires permission to access the CreateBillingGroup action.
Parameters:
Raises:
Source code in docs_src/capo_iot/_services/async_io_t.py
| async def create_billing_group(
self,
billing_group_name: "capo_iot.types.billing_group_name.BillingGroupName",
*,
config_overrides: Optional[AsyncIoTClientConfig] = None,
billing_group_properties: Optional[
"capo_iot.types.billing_group_properties.BillingGroupProperties"
] = None,
tags: Optional["capo_iot.types.tag_list.TagList"] = None,
) -> "capo_iot.types.create_billing_group_response.CreateBillingGroupResponse":
"""<p>Creates a billing group. If this call is made multiple times using the same billing group name and configuration, the call will succeed. If this call is made with the same billing group name but different configuration a <code>ResourceAlreadyExistsException</code> is thrown.</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">CreateBillingGroup</a> action.</p>
Args:
billing_group_name: <p>The name you wish to give to the billing group.</p>
billing_group_properties: <p>The properties of the billing group.</p>
tags: <p>Metadata which can be used to manage 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_already_exists_exception.ResourceAlreadyExistsException: <p>The resource already exists.</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.create_billing_group_request.CreateBillingGroupRequest]",
) -> AsyncOperationResponse[
"capo_iot.types.create_billing_group_response.CreateBillingGroupResponse"
]:
import capo_iot._operations.aws_iot_service.create_billing_group
(
output,
http_response,
) = await capo_iot._operations.aws_iot_service.create_billing_group.async_create_billing_group(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateBillingGroup")
)
input_: capo_iot.types.create_billing_group_request.CreateBillingGroupRequest = {
"billing_group_name": billing_group_name
}
if billing_group_properties is not None:
input_["billing_group_properties"] = billing_group_properties
if tags is not None:
input_["tags"] = tags
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|