updateLimit method

Future<void> updateLimit({
  1. required String farmId,
  2. required String limitId,
  3. String? description,
  4. String? displayName,
  5. int? maxCount,
})

Updates the properties of the specified limit.

May throw AccessDeniedException. May throw InternalServerErrorException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter farmId : The unique identifier of the farm that contains the limit.

Parameter limitId : The unique identifier of the limit to update.

Parameter description : The new description of the limit.

Parameter displayName : The new display name of the limit.

Parameter maxCount : The maximum number of resources constrained by this limit. When all of the resources are in use, steps that require the limit won't be scheduled until the resource is available.

If more than the new maximum number is currently in use, running jobs finish but no new jobs are started until the number of resources in use is below the new maximum number.

The maxCount must not be 0. If the value is -1, there is no restriction on the number of resources that can be acquired for this limit.

Implementation

Future<void> updateLimit({
  required String farmId,
  required String limitId,
  String? description,
  String? displayName,
  int? maxCount,
}) async {
  _s.validateNumRange(
    'maxCount',
    maxCount,
    -1,
    2147483647,
  );
  final $payload = <String, dynamic>{
    if (description != null) 'description': description,
    if (displayName != null) 'displayName': displayName,
    if (maxCount != null) 'maxCount': maxCount,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/limits/${Uri.encodeComponent(limitId)}',
    exceptionFnMap: _exceptionFns,
  );
}