updateWorker method

Future<UpdateWorkerResponse> updateWorker({
  1. required String farmId,
  2. required String fleetId,
  3. required String workerId,
  4. WorkerCapabilities? capabilities,
  5. HostPropertiesRequest? hostProperties,
  6. UpdatedWorkerStatus? status,
})

Updates a worker.

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

Parameter farmId : The farm ID to update.

Parameter fleetId : The fleet ID to update.

Parameter workerId : The worker ID to update.

Parameter capabilities : The worker capabilities to update.

Parameter hostProperties : The host properties to update.

Parameter status : The worker status to update.

Implementation

Future<UpdateWorkerResponse> updateWorker({
  required String farmId,
  required String fleetId,
  required String workerId,
  WorkerCapabilities? capabilities,
  HostPropertiesRequest? hostProperties,
  UpdatedWorkerStatus? status,
}) async {
  final $payload = <String, dynamic>{
    if (capabilities != null) 'capabilities': capabilities,
    if (hostProperties != null) 'hostProperties': hostProperties,
    if (status != null) 'status': status.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}/workers/${Uri.encodeComponent(workerId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateWorkerResponse.fromJson(response);
}