updateJob method

Future<void> updateJob({
  1. required String jobId,
  2. String? addressId,
  3. String? description,
  4. String? forwardingAddressId,
  5. Notification? notification,
  6. JobResource? resources,
  7. String? roleARN,
  8. ShippingOption? shippingOption,
  9. SnowballCapacity? snowballCapacityPreference,
})

While a job's JobState value is New, you can update some of the information associated with a job. Once the job changes to a different job state, usually within 60 minutes of the job being created, this action is no longer available.

May throw InvalidResourceException. May throw InvalidJobStateException. May throw KMSRequestFailedException. May throw InvalidInputCombinationException. May throw ClusterLimitExceededException. May throw Ec2RequestFailedException.

Parameter jobId : The job ID of the job that you want to update, for example JID123e4567-e89b-12d3-a456-426655440000.

Parameter addressId : The ID of the updated Address object.

Parameter description : The updated description of this job's JobMetadata object.

Parameter forwardingAddressId : The updated ID for the forwarding address for a job. This field is not supported in most regions.

Parameter notification : The new or updated Notification object.

Parameter resources : The updated JobResource object, or the updated JobResource object.

Parameter roleARN : The new role Amazon Resource Name (ARN) that you want to associate with this job. To create a role ARN, use the CreateRoleAWS Identity and Access Management (IAM) API action.

Parameter shippingOption : The updated shipping option value of this job's ShippingDetails object.

Parameter snowballCapacityPreference : The updated SnowballCapacityPreference of this job's JobMetadata object. The 50 TB Snowballs are only available in the US regions.

Implementation

Future<void> updateJob({
  required String jobId,
  String? addressId,
  String? description,
  String? forwardingAddressId,
  Notification? notification,
  JobResource? resources,
  String? roleARN,
  ShippingOption? shippingOption,
  SnowballCapacity? snowballCapacityPreference,
}) async {
  ArgumentError.checkNotNull(jobId, 'jobId');
  _s.validateStringLength(
    'jobId',
    jobId,
    39,
    39,
    isRequired: true,
  );
  _s.validateStringLength(
    'addressId',
    addressId,
    40,
    40,
  );
  _s.validateStringLength(
    'description',
    description,
    1,
    1152921504606846976,
  );
  _s.validateStringLength(
    'forwardingAddressId',
    forwardingAddressId,
    40,
    40,
  );
  _s.validateStringLength(
    'roleARN',
    roleARN,
    0,
    255,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSIESnowballJobManagementService.UpdateJob'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'JobId': jobId,
      if (addressId != null) 'AddressId': addressId,
      if (description != null) 'Description': description,
      if (forwardingAddressId != null)
        'ForwardingAddressId': forwardingAddressId,
      if (notification != null) 'Notification': notification,
      if (resources != null) 'Resources': resources,
      if (roleARN != null) 'RoleARN': roleARN,
      if (shippingOption != null) 'ShippingOption': shippingOption.toValue(),
      if (snowballCapacityPreference != null)
        'SnowballCapacityPreference': snowballCapacityPreference.toValue(),
    },
  );
}