def get_stream_session(
self,
channel_arn: "capo_ivs.types.channel_arn.ChannelArn",
*,
config_overrides: Optional[ivsClientConfig] = None,
stream_id: Optional["capo_ivs.types.stream_id.StreamId"] = None,
) -> "capo_ivs.types.get_stream_session_response.GetStreamSessionResponse":
"""<p>Gets metadata on a specified stream.</p>
Args:
channel_arn: <p>ARN of the channel resource</p>
stream_id: <p>Unique identifier for a live or previously live stream in the specified channel. If no <code>streamId</code> is provided, this returns the most recent stream session for the channel, if it exists.</p>
Raises:
capo_ivs.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
capo_ivs.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
capo_ivs.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
capo_ivs.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_ivs.types.get_stream_session_request.GetStreamSessionRequest]",
) -> OperationResponse[
"capo_ivs.types.get_stream_session_response.GetStreamSessionResponse"
]:
import capo_ivs._operations.amazon_interactive_video_service.get_stream_session
output, http_response = (
capo_ivs._operations.amazon_interactive_video_service.get_stream_session.get_stream_session(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_ivs.types.get_stream_session_response.GetStreamSessionResponse",
) -> dict[str, Any]:
import capo_ivs.types.get_stream_session_response
return capo_ivs.types.get_stream_session_response.redact_sensitive(output)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("GetStreamSession", redact_output=_redact_output),
)
input_: capo_ivs.types.get_stream_session_request.GetStreamSessionRequest = {
"channel_arn": channel_arn
}
if stream_id is not None:
input_["stream_id"] = stream_id
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output