Updates the state when a shipment state changes to a different state.
Parameters:
-
job_id
(JobId)
–
The job ID of the job whose shipment date you want to update, for example JID123e4567-e89b-12d3-a456-426655440000.
-
shipment_state
(ShipmentState)
–
The state of a device when it is being shipped.
Set to RECEIVED when the device arrives at your location.
Set to RETURNED when you have returned the device to Amazon Web Services.
Raises:
-
InvalidJobStateException
–
The action can't be performed because the job's current state doesn't allow that action to be performed.
-
InvalidResourceException
–
The specified resource can't be found. Check the information you provided in your last request, and try again.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_snowball/_services/snowball.py
| def update_job_shipment_state(
self,
job_id: "capo_snowball.types.job_id.JobId",
shipment_state: "capo_snowball.types.shipment_state.ShipmentState",
*,
config_overrides: Optional[SnowballClientConfig] = None,
) -> "capo_snowball.types.update_job_shipment_state_result.UpdateJobShipmentStateResult":
"""<p>Updates the state when a shipment state changes to a different state.</p>
Args:
job_id: <p>The job ID of the job whose shipment date you want to update, for example <code>JID123e4567-e89b-12d3-a456-426655440000</code>.</p>
shipment_state: <p>The state of a device when it is being shipped. </p> <p>Set to <code>RECEIVED</code> when the device arrives at your location.</p> <p>Set to <code>RETURNED</code> when you have returned the device to Amazon Web Services.</p>
Raises:
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.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_snowball.types.update_job_shipment_state_request.UpdateJobShipmentStateRequest]",
) -> OperationResponse[
"capo_snowball.types.update_job_shipment_state_result.UpdateJobShipmentStateResult"
]:
import capo_snowball._operations.awsie_snowball_job_management_service.update_job_shipment_state
output, http_response = (
capo_snowball._operations.awsie_snowball_job_management_service.update_job_shipment_state.update_job_shipment_state(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateJobShipmentState")
)
input_: capo_snowball.types.update_job_shipment_state_request.UpdateJobShipmentStateRequest = {
"job_id": job_id,
"shipment_state": shipment_state,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|