async def create_image_builder_streaming_url(
self,
*,
config_overrides: Optional[AsyncAppStreamClientConfig] = None,
name: Optional["capo_appstream.types.string.String"] = None,
validity: Optional["capo_appstream.types.long.Long"] = None,
) -> "capo_appstream.types.create_image_builder_streaming_url_result.CreateImageBuilderStreamingURLResult":
"""<p>Creates a URL to start an image builder streaming session.</p>
Args:
name: <p>The name of the image builder.</p>
validity: <p>The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. The default is 3600 seconds.</p>
Raises:
capo_appstream.errors.operation_not_permitted_exception.OperationNotPermittedException: <p>The attempted operation is not permitted.</p>
capo_appstream.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
capo_appstream.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_appstream.types.create_image_builder_streaming_url_request.CreateImageBuilderStreamingURLRequest]",
) -> AsyncOperationResponse[
"capo_appstream.types.create_image_builder_streaming_url_result.CreateImageBuilderStreamingURLResult"
]:
if req.options.protocol == "awsJson1_1":
import capo_appstream._operations.photon_admin_proxy_service.aws_json1_1.create_image_builder_streaming_url
(
output,
http_response,
) = await capo_appstream._operations.photon_admin_proxy_service.aws_json1_1.create_image_builder_streaming_url.async_create_image_builder_streaming_url(
req.options, req.input
)
elif req.options.protocol == "rpcv2Cbor":
import capo_appstream._operations.photon_admin_proxy_service.rpcv2_cbor.create_image_builder_streaming_url
(
output,
http_response,
) = await capo_appstream._operations.photon_admin_proxy_service.rpcv2_cbor.create_image_builder_streaming_url.async_create_image_builder_streaming_url(
req.options, req.input
)
else:
raise ValueError(f"unknown protocol {req.options.protocol!r}")
return AsyncOperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_appstream.types.create_image_builder_streaming_url_result.CreateImageBuilderStreamingURLResult",
) -> dict[str, Any]:
import capo_appstream.types.create_image_builder_streaming_url_result
return capo_appstream.types.create_image_builder_streaming_url_result.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging(
"CreateImageBuilderStreamingURL", redact_output=_redact_output
),
)
input_: capo_appstream.types.create_image_builder_streaming_url_request.CreateImageBuilderStreamingURLRequest = {}
if name is not None:
input_["name"] = name
if validity is not None:
input_["validity"] = validity
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output