1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Specifies a live video stream that has been ingested and distributed.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Stream {
/// <p>Channel ARN for the stream.</p>
pub channel_arn: ::std::option::Option<::std::string::String>,
/// <p>Unique identifier for a live or previously live stream in the specified channel.</p>
pub stream_id: ::std::option::Option<::std::string::String>,
/// <p>URL of the master playlist, required by the video player to play the HLS stream.</p>
pub playback_url: ::std::option::Option<::std::string::String>,
/// <p>Time of the stream’s start. This is an ISO 8601 timestamp; <i>note that this is returned as a string</i>.</p>
pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The stream’s state. Do not rely on the <code>OFFLINE</code> state, as the API may not return it; instead, a "NotBroadcasting" error will indicate that the stream is not live.</p>
pub state: ::std::option::Option<crate::types::StreamState>,
/// <p>The stream’s health.</p>
pub health: ::std::option::Option<crate::types::StreamHealth>,
/// <p>A count of concurrent views of the stream. Typically, a new view appears in <code>viewerCount</code> within 15 seconds of when video playback starts and a view is removed from <code>viewerCount</code> within 1 minute of when video playback ends. A value of -1 indicates that the request timed out; in this case, retry.</p>
pub viewer_count: i64,
}
impl Stream {
/// <p>Channel ARN for the stream.</p>
pub fn channel_arn(&self) -> ::std::option::Option<&str> {
self.channel_arn.as_deref()
}
/// <p>Unique identifier for a live or previously live stream in the specified channel.</p>
pub fn stream_id(&self) -> ::std::option::Option<&str> {
self.stream_id.as_deref()
}
/// <p>URL of the master playlist, required by the video player to play the HLS stream.</p>
pub fn playback_url(&self) -> ::std::option::Option<&str> {
self.playback_url.as_deref()
}
/// <p>Time of the stream’s start. This is an ISO 8601 timestamp; <i>note that this is returned as a string</i>.</p>
pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.start_time.as_ref()
}
/// <p>The stream’s state. Do not rely on the <code>OFFLINE</code> state, as the API may not return it; instead, a "NotBroadcasting" error will indicate that the stream is not live.</p>
pub fn state(&self) -> ::std::option::Option<&crate::types::StreamState> {
self.state.as_ref()
}
/// <p>The stream’s health.</p>
pub fn health(&self) -> ::std::option::Option<&crate::types::StreamHealth> {
self.health.as_ref()
}
/// <p>A count of concurrent views of the stream. Typically, a new view appears in <code>viewerCount</code> within 15 seconds of when video playback starts and a view is removed from <code>viewerCount</code> within 1 minute of when video playback ends. A value of -1 indicates that the request timed out; in this case, retry.</p>
pub fn viewer_count(&self) -> i64 {
self.viewer_count
}
}
impl Stream {
/// Creates a new builder-style object to manufacture [`Stream`](crate::types::Stream).
pub fn builder() -> crate::types::builders::StreamBuilder {
crate::types::builders::StreamBuilder::default()
}
}
/// A builder for [`Stream`](crate::types::Stream).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StreamBuilder {
pub(crate) channel_arn: ::std::option::Option<::std::string::String>,
pub(crate) stream_id: ::std::option::Option<::std::string::String>,
pub(crate) playback_url: ::std::option::Option<::std::string::String>,
pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) state: ::std::option::Option<crate::types::StreamState>,
pub(crate) health: ::std::option::Option<crate::types::StreamHealth>,
pub(crate) viewer_count: ::std::option::Option<i64>,
}
impl StreamBuilder {
/// <p>Channel ARN for the stream.</p>
pub fn channel_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.channel_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>Channel ARN for the stream.</p>
pub fn set_channel_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.channel_arn = input;
self
}
/// <p>Channel ARN for the stream.</p>
pub fn get_channel_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.channel_arn
}
/// <p>Unique identifier for a live or previously live stream in the specified channel.</p>
pub fn stream_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.stream_id = ::std::option::Option::Some(input.into());
self
}
/// <p>Unique identifier for a live or previously live stream in the specified channel.</p>
pub fn set_stream_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.stream_id = input;
self
}
/// <p>Unique identifier for a live or previously live stream in the specified channel.</p>
pub fn get_stream_id(&self) -> &::std::option::Option<::std::string::String> {
&self.stream_id
}
/// <p>URL of the master playlist, required by the video player to play the HLS stream.</p>
pub fn playback_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.playback_url = ::std::option::Option::Some(input.into());
self
}
/// <p>URL of the master playlist, required by the video player to play the HLS stream.</p>
pub fn set_playback_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.playback_url = input;
self
}
/// <p>URL of the master playlist, required by the video player to play the HLS stream.</p>
pub fn get_playback_url(&self) -> &::std::option::Option<::std::string::String> {
&self.playback_url
}
/// <p>Time of the stream’s start. This is an ISO 8601 timestamp; <i>note that this is returned as a string</i>.</p>
pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.start_time = ::std::option::Option::Some(input);
self
}
/// <p>Time of the stream’s start. This is an ISO 8601 timestamp; <i>note that this is returned as a string</i>.</p>
pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.start_time = input;
self
}
/// <p>Time of the stream’s start. This is an ISO 8601 timestamp; <i>note that this is returned as a string</i>.</p>
pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.start_time
}
/// <p>The stream’s state. Do not rely on the <code>OFFLINE</code> state, as the API may not return it; instead, a "NotBroadcasting" error will indicate that the stream is not live.</p>
pub fn state(mut self, input: crate::types::StreamState) -> Self {
self.state = ::std::option::Option::Some(input);
self
}
/// <p>The stream’s state. Do not rely on the <code>OFFLINE</code> state, as the API may not return it; instead, a "NotBroadcasting" error will indicate that the stream is not live.</p>
pub fn set_state(mut self, input: ::std::option::Option<crate::types::StreamState>) -> Self {
self.state = input;
self
}
/// <p>The stream’s state. Do not rely on the <code>OFFLINE</code> state, as the API may not return it; instead, a "NotBroadcasting" error will indicate that the stream is not live.</p>
pub fn get_state(&self) -> &::std::option::Option<crate::types::StreamState> {
&self.state
}
/// <p>The stream’s health.</p>
pub fn health(mut self, input: crate::types::StreamHealth) -> Self {
self.health = ::std::option::Option::Some(input);
self
}
/// <p>The stream’s health.</p>
pub fn set_health(mut self, input: ::std::option::Option<crate::types::StreamHealth>) -> Self {
self.health = input;
self
}
/// <p>The stream’s health.</p>
pub fn get_health(&self) -> &::std::option::Option<crate::types::StreamHealth> {
&self.health
}
/// <p>A count of concurrent views of the stream. Typically, a new view appears in <code>viewerCount</code> within 15 seconds of when video playback starts and a view is removed from <code>viewerCount</code> within 1 minute of when video playback ends. A value of -1 indicates that the request timed out; in this case, retry.</p>
pub fn viewer_count(mut self, input: i64) -> Self {
self.viewer_count = ::std::option::Option::Some(input);
self
}
/// <p>A count of concurrent views of the stream. Typically, a new view appears in <code>viewerCount</code> within 15 seconds of when video playback starts and a view is removed from <code>viewerCount</code> within 1 minute of when video playback ends. A value of -1 indicates that the request timed out; in this case, retry.</p>
pub fn set_viewer_count(mut self, input: ::std::option::Option<i64>) -> Self {
self.viewer_count = input;
self
}
/// <p>A count of concurrent views of the stream. Typically, a new view appears in <code>viewerCount</code> within 15 seconds of when video playback starts and a view is removed from <code>viewerCount</code> within 1 minute of when video playback ends. A value of -1 indicates that the request timed out; in this case, retry.</p>
pub fn get_viewer_count(&self) -> &::std::option::Option<i64> {
&self.viewer_count
}
/// Consumes the builder and constructs a [`Stream`](crate::types::Stream).
pub fn build(self) -> crate::types::Stream {
crate::types::Stream {
channel_arn: self.channel_arn,
stream_id: self.stream_id,
playback_url: self.playback_url,
start_time: self.start_time,
state: self.state,
health: self.health,
viewer_count: self.viewer_count.unwrap_or_default(),
}
}
}