batchAssociateResourcesToCustomLineItem method

Future<BatchAssociateResourcesToCustomLineItemOutput> batchAssociateResourcesToCustomLineItem({
  1. required List<String> resourceArns,
  2. required String targetArn,
  3. CustomLineItemBillingPeriodRange? billingPeriodRange,
})

Associates a batch of resources to a percentage custom line item.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceLimitExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter resourceArns : A list containing the ARNs of the resources to be associated.

Parameter targetArn : A percentage custom line item ARN to associate the resources to.

Implementation

Future<BatchAssociateResourcesToCustomLineItemOutput>
    batchAssociateResourcesToCustomLineItem({
  required List<String> resourceArns,
  required String targetArn,
  CustomLineItemBillingPeriodRange? billingPeriodRange,
}) async {
  final $payload = <String, dynamic>{
    'ResourceArns': resourceArns,
    'TargetArn': targetArn,
    if (billingPeriodRange != null) 'BillingPeriodRange': billingPeriodRange,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/batch-associate-resources-to-custom-line-item',
    exceptionFnMap: _exceptionFns,
  );
  return BatchAssociateResourcesToCustomLineItemOutput.fromJson(response);
}