Skip to content

create_return_shipping_label async

create_return_shipping_label(
    job_id: JobId,
    *,
    config_overrides: Optional[AsyncSnowballClientConfig] = None,
    shipping_option: Optional[ShippingOption] = None,
) -> CreateReturnShippingLabelResult

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

Parameters:

  • job_id (JobId) –

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

  • shipping_option (Optional[ShippingOption], default: None ) –

    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:

Raises:

Source code in docs_src/capo_snowball/_services/async_snowball.py
async def create_return_shipping_label(
    self,
    job_id: "capo_snowball.types.job_id.JobId",
    *,
    config_overrides: Optional[AsyncSnowballClientConfig] = None,
    shipping_option: Optional[
        "capo_snowball.types.shipping_option.ShippingOption"
    ] = None,
) -> "capo_snowball.types.create_return_shipping_label_result.CreateReturnShippingLabelResult":
    """<p>Creates a shipping label that will be used to return the Snow device to Amazon Web Services.</p>

    Args:
        job_id: <p>The ID for a job that you want to create the return shipping label for; for example, <code>JID123e4567-e89b-12d3-a456-426655440000</code>.</p>
        shipping_option: <p>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:</p>

    Raises:
        capo_snowball.errors.conflict_exception.ConflictException: <p>You get this exception when you call <code>CreateReturnShippingLabel</code> more than once when other requests are not completed.</p>
        capo_snowball.errors.invalid_input_combination_exception.InvalidInputCombinationException: <p>Job or cluster creation failed. One or more inputs were invalid. Confirm that the <a>CreateClusterRequest$SnowballType</a> value supports your <a>CreateJobRequest$JobType</a>, and try again.</p>
        capo_snowball.errors.invalid_job_state_exception.InvalidJobStateException: <p>The action can't be performed because the job's current state doesn't allow that action to be performed.</p>
        capo_snowball.errors.invalid_resource_exception.InvalidResourceException: <p>The specified resource can't be found. Check the information you provided in your last request, and try again.</p>
        capo_snowball.errors.return_shipping_label_already_exists_exception.ReturnShippingLabelAlreadyExistsException: <p>You get this exception if you call <code>CreateReturnShippingLabel</code> and a valid return shipping label already exists. In this case, use <code>DescribeReturnShippingLabel</code> to get the URL.</p>
        capo_snowball.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_snowball.types.create_return_shipping_label_request.CreateReturnShippingLabelRequest]",
    ) -> AsyncOperationResponse[
        "capo_snowball.types.create_return_shipping_label_result.CreateReturnShippingLabelResult"
    ]:
        import capo_snowball._operations.awsie_snowball_job_management_service.create_return_shipping_label

        (
            output,
            http_response,
        ) = await capo_snowball._operations.awsie_snowball_job_management_service.create_return_shipping_label.async_create_return_shipping_label(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateReturnShippingLabel")
    )
    input_: capo_snowball.types.create_return_shipping_label_request.CreateReturnShippingLabelRequest = {
        "job_id": job_id
    }
    if shipping_option is not None:
        input_["shipping_option"] = shipping_option

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output