createReturnShippingLabel method

Future<CreateReturnShippingLabelResult> createReturnShippingLabel({
  1. required String jobId,
  2. ShippingOption? shippingOption,
})

Creates a shipping label that will be used to return the Snow device to Amazon Web Services.

May throw ConflictException. May throw InvalidInputCombinationException. May throw InvalidJobStateException. May throw InvalidResourceException. May throw ReturnShippingLabelAlreadyExistsException.

Parameter jobId : The ID for a job that you want to create the return shipping label for; for example, JID123e4567-e89b-12d3-a456-426655440000.

Parameter shippingOption : The shipping speed for a particular job. This speed doesn't dictate how soon the device is returned to Amazon Web Services. This speed represents how quickly it moves to its destination while in transit. Regional shipping speeds are as follows:

Implementation

Future<CreateReturnShippingLabelResult> createReturnShippingLabel({
  required String jobId,
  ShippingOption? shippingOption,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AWSIESnowballJobManagementService.CreateReturnShippingLabel'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'JobId': jobId,
      if (shippingOption != null) 'ShippingOption': shippingOption.value,
    },
  );

  return CreateReturnShippingLabelResult.fromJson(jsonResponse.body);
}