updateComponent method

Future<void> updateComponent({
  1. required String componentName,
  2. required String resourceGroupName,
  3. String? newComponentName,
  4. List<String>? resourceList,
})

Updates the custom component name and/or the list of resources that make up the component.

May throw ResourceInUseException. May throw ResourceNotFoundException. May throw ValidationException. May throw InternalServerException.

Parameter componentName : The name of the component.

Parameter resourceGroupName : The name of the resource group.

Parameter newComponentName : The new name of the component.

Parameter resourceList : The list of resource ARNs that belong to the component.

Implementation

Future<void> updateComponent({
  required String componentName,
  required String resourceGroupName,
  String? newComponentName,
  List<String>? resourceList,
}) async {
  ArgumentError.checkNotNull(componentName, 'componentName');
  _s.validateStringLength(
    'componentName',
    componentName,
    1,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(resourceGroupName, 'resourceGroupName');
  _s.validateStringLength(
    'resourceGroupName',
    resourceGroupName,
    1,
    256,
    isRequired: true,
  );
  _s.validateStringLength(
    'newComponentName',
    newComponentName,
    1,
    128,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'EC2WindowsBarleyService.UpdateComponent'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ComponentName': componentName,
      'ResourceGroupName': resourceGroupName,
      if (newComponentName != null) 'NewComponentName': newComponentName,
      if (resourceList != null) 'ResourceList': resourceList,
    },
  );
}