createBillingGroup method
Future<CreateBillingGroupResponse>
createBillingGroup({
- required String billingGroupName,
- BillingGroupProperties? billingGroupProperties,
- List<
Tag> ? tags,
Creates a billing group.
May throw InvalidRequestException. May throw ResourceAlreadyExistsException. May throw ThrottlingException. May throw InternalFailureException.
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 {
ArgumentError.checkNotNull(billingGroupName, 'billingGroupName');
_s.validateStringLength(
'billingGroupName',
billingGroupName,
1,
128,
isRequired: true,
);
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);
}