createBillingGroup method

Future<CreateBillingGroupResponse> createBillingGroup({
  1. required String billingGroupName,
  2. BillingGroupProperties? billingGroupProperties,
  3. List<Tag>? tags,
})

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.

May throw InternalFailureException. May throw InvalidRequestException. May throw ResourceAlreadyExistsException. May throw ThrottlingException.

Parameter billingGroupName : The name you wish to give to the billing group.

Parameter billingGroupProperties : The properties of the billing group.

Parameter tags : Metadata which can be used to manage the billing group.

Implementation

Future<CreateBillingGroupResponse> createBillingGroup({
  required String billingGroupName,
  BillingGroupProperties? billingGroupProperties,
  List<Tag>? tags,
}) async {
  final $payload = <String, dynamic>{
    if (billingGroupProperties != null)
      'billingGroupProperties': billingGroupProperties,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/billing-groups/${Uri.encodeComponent(billingGroupName)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateBillingGroupResponse.fromJson(response);
}