associateBudgetWithResource method

Future<void> associateBudgetWithResource({
  1. required String budgetName,
  2. required String resourceId,
})

Associates the specified budget with the specified resource.

May throw InvalidParametersException. May throw DuplicateResourceException. May throw LimitExceededException. May throw ResourceNotFoundException.

Parameter budgetName : The name of the budget you want to associate.

Parameter resourceId : The resource identifier. Either a portfolio-id or a product-id.

Implementation

Future<void> associateBudgetWithResource({
  required String budgetName,
  required String resourceId,
}) async {
  ArgumentError.checkNotNull(budgetName, 'budgetName');
  _s.validateStringLength(
    'budgetName',
    budgetName,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(resourceId, 'resourceId');
  _s.validateStringLength(
    'resourceId',
    resourceId,
    1,
    100,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWS242ServiceCatalogService.AssociateBudgetWithResource'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'BudgetName': budgetName,
      'ResourceId': resourceId,
    },
  );
}