1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
2
3package kinesisvideoarchivedmedia
4
5import (
6	"io"
7	"time"
8
9	"github.com/aws/aws-sdk-go/aws"
10	"github.com/aws/aws-sdk-go/aws/awsutil"
11	"github.com/aws/aws-sdk-go/aws/request"
12)
13
14const opGetDASHStreamingSessionURL = "GetDASHStreamingSessionURL"
15
16// GetDASHStreamingSessionURLRequest generates a "aws/request.Request" representing the
17// client's request for the GetDASHStreamingSessionURL operation. The "output" return
18// value will be populated with the request's response once the request completes
19// successfully.
20//
21// Use "Send" method on the returned Request to send the API call to the service.
22// the "output" return value is not valid until after Send returns without error.
23//
24// See GetDASHStreamingSessionURL for more information on using the GetDASHStreamingSessionURL
25// API call, and error handling.
26//
27// This method is useful when you want to inject custom logic or configuration
28// into the SDK's request lifecycle. Such as custom headers, or retry logic.
29//
30//
31//    // Example sending a request using the GetDASHStreamingSessionURLRequest method.
32//    req, resp := client.GetDASHStreamingSessionURLRequest(params)
33//
34//    err := req.Send()
35//    if err == nil { // resp is now filled
36//        fmt.Println(resp)
37//    }
38//
39// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/GetDASHStreamingSessionURL
40func (c *KinesisVideoArchivedMedia) GetDASHStreamingSessionURLRequest(input *GetDASHStreamingSessionURLInput) (req *request.Request, output *GetDASHStreamingSessionURLOutput) {
41	op := &request.Operation{
42		Name:       opGetDASHStreamingSessionURL,
43		HTTPMethod: "POST",
44		HTTPPath:   "/getDASHStreamingSessionURL",
45	}
46
47	if input == nil {
48		input = &GetDASHStreamingSessionURLInput{}
49	}
50
51	output = &GetDASHStreamingSessionURLOutput{}
52	req = c.newRequest(op, input, output)
53	return
54}
55
56// GetDASHStreamingSessionURL API operation for Amazon Kinesis Video Streams Archived Media.
57//
58// Retrieves an MPEG Dynamic Adaptive Streaming over HTTP (DASH) URL for the
59// stream. You can then open the URL in a media player to view the stream contents.
60//
61// Both the StreamName and the StreamARN parameters are optional, but you must
62// specify either the StreamName or the StreamARN when invoking this API operation.
63//
64// An Amazon Kinesis video stream has the following requirements for providing
65// data through MPEG-DASH:
66//
67//    * The media must contain h.264 or h.265 encoded video and, optionally,
68//    AAC or G.711 encoded audio. Specifically, the codec ID of track 1 should
69//    be V_MPEG/ISO/AVC (for h.264) or V_MPEGH/ISO/HEVC (for H.265). Optionally,
70//    the codec ID of track 2 should be A_AAC (for AAC) or A_MS/ACM (for G.711).
71//
72//    * Data retention must be greater than 0.
73//
74//    * The video track of each fragment must contain codec private data in
75//    the Advanced Video Coding (AVC) for H.264 format and HEVC for H.265 format.
76//    For more information, see MPEG-4 specification ISO/IEC 14496-15 (https://www.iso.org/standard/55980.html).
77//    For information about adapting stream data to a given format, see NAL
78//    Adaptation Flags (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/producer-reference-nal.html).
79//
80//    * The audio track (if present) of each fragment must contain codec private
81//    data in the AAC format (AAC specification ISO/IEC 13818-7 (https://www.iso.org/standard/43345.html))
82//    or the MS Wave format (http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html).
83//
84// The following procedure shows how to use MPEG-DASH with Kinesis Video Streams:
85//
86// Get an endpoint using GetDataEndpoint (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_GetDataEndpoint.html),
87// specifying GET_DASH_STREAMING_SESSION_URL for the APIName parameter.
88//
89// Retrieve the MPEG-DASH URL using GetDASHStreamingSessionURL. Kinesis Video
90// Streams creates an MPEG-DASH streaming session to be used for accessing content
91// in a stream using the MPEG-DASH protocol. GetDASHStreamingSessionURL returns
92// an authenticated URL (that includes an encrypted session token) for the session's
93// MPEG-DASH manifest (the root resource needed for streaming with MPEG-DASH).
94//
95// Don't share or store this token where an unauthorized entity could access
96// it. The token provides access to the content of the stream. Safeguard the
97// token with the same measures that you would use with your AWS credentials.
98//
99// The media that is made available through the manifest consists only of the
100// requested stream, time range, and format. No other media data (such as frames
101// outside the requested window or alternate bitrates) is made available.
102//
103// Provide the URL (containing the encrypted session token) for the MPEG-DASH
104// manifest to a media player that supports the MPEG-DASH protocol. Kinesis
105// Video Streams makes the initialization fragment and media fragments available
106// through the manifest URL. The initialization fragment contains the codec
107// private data for the stream, and other data needed to set up the video or
108// audio decoder and renderer. The media fragments contain encoded video frames
109// or encoded audio samples.
110//
111// The media player receives the authenticated URL and requests stream metadata
112// and media data normally. When the media player requests data, it calls the
113// following actions:
114//
115//    * GetDASHManifest: Retrieves an MPEG DASH manifest, which contains the
116//    metadata for the media that you want to playback.
117//
118//    * GetMP4InitFragment: Retrieves the MP4 initialization fragment. The media
119//    player typically loads the initialization fragment before loading any
120//    media fragments. This fragment contains the "fytp" and "moov" MP4 atoms,
121//    and the child atoms that are needed to initialize the media player decoder.
122//    The initialization fragment does not correspond to a fragment in a Kinesis
123//    video stream. It contains only the codec private data for the stream and
124//    respective track, which the media player needs to decode the media frames.
125//
126//    * GetMP4MediaFragment: Retrieves MP4 media fragments. These fragments
127//    contain the "moof" and "mdat" MP4 atoms and their child atoms, containing
128//    the encoded fragment's media frames and their timestamps. After the first
129//    media fragment is made available in a streaming session, any fragments
130//    that don't contain the same codec private data cause an error to be returned
131//    when those different media fragments are loaded. Therefore, the codec
132//    private data should not change between fragments in a session. This also
133//    means that the session fails if the fragments in a stream change from
134//    having only video to having both audio and video. Data retrieved with
135//    this action is billable. See Pricing (https://aws.amazon.com/kinesis/video-streams/pricing/)
136//    for details.
137//
138// The following restrictions apply to MPEG-DASH sessions:
139//
140//    * A streaming session URL should not be shared between players. The service
141//    might throttle a session if multiple media players are sharing it. For
142//    connection limits, see Kinesis Video Streams Limits (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/limits.html).
143//
144//    * A Kinesis video stream can have a maximum of ten active MPEG-DASH streaming
145//    sessions. If a new session is created when the maximum number of sessions
146//    is already active, the oldest (earliest created) session is closed. The
147//    number of active GetMedia connections on a Kinesis video stream does not
148//    count against this limit, and the number of active MPEG-DASH sessions
149//    does not count against the active GetMedia connection limit. The maximum
150//    limits for active HLS and MPEG-DASH streaming sessions are independent
151//    of each other.
152//
153// You can monitor the amount of data that the media player consumes by monitoring
154// the GetMP4MediaFragment.OutgoingBytes Amazon CloudWatch metric. For information
155// about using CloudWatch to monitor Kinesis Video Streams, see Monitoring Kinesis
156// Video Streams (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/monitoring.html).
157// For pricing information, see Amazon Kinesis Video Streams Pricing (https://aws.amazon.com/kinesis/video-streams/pricing/)
158// and AWS Pricing (https://aws.amazon.com/pricing/). Charges for both HLS sessions
159// and outgoing AWS data apply.
160//
161// For more information about HLS, see HTTP Live Streaming (https://developer.apple.com/streaming/)
162// on the Apple Developer site (https://developer.apple.com).
163//
164// If an error is thrown after invoking a Kinesis Video Streams archived media
165// API, in addition to the HTTP status code and the response body, it includes
166// the following pieces of information:
167//
168//    * x-amz-ErrorType HTTP header – contains a more specific error type
169//    in addition to what the HTTP status code provides.
170//
171//    * x-amz-RequestId HTTP header – if you want to report an issue to AWS,
172//    the support team can better diagnose the problem if given the Request
173//    Id.
174//
175// Both the HTTP status code and the ErrorType header can be utilized to make
176// programmatic decisions about whether errors are retry-able and under what
177// conditions, as well as provide information on what actions the client programmer
178// might need to take in order to successfully try again.
179//
180// For more information, see the Errors section at the bottom of this topic,
181// as well as Common Errors (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/CommonErrors.html).
182//
183// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
184// with awserr.Error's Code and Message methods to get detailed information about
185// the error.
186//
187// See the AWS API reference guide for Amazon Kinesis Video Streams Archived Media's
188// API operation GetDASHStreamingSessionURL for usage and error information.
189//
190// Returned Error Codes:
191//   * ErrCodeResourceNotFoundException "ResourceNotFoundException"
192//   GetMedia throws this error when Kinesis Video Streams can't find the stream
193//   that you specified.
194//
195//   GetHLSStreamingSessionURL and GetDASHStreamingSessionURL throw this error
196//   if a session with a PlaybackMode of ON_DEMAND or LIVE_REPLAYis requested
197//   for a stream that has no fragments within the requested time range, or if
198//   a session with a PlaybackMode of LIVE is requested for a stream that has
199//   no fragments within the last 30 seconds.
200//
201//   * ErrCodeInvalidArgumentException "InvalidArgumentException"
202//   A specified parameter exceeds its restrictions, is not supported, or can't
203//   be used.
204//
205//   * ErrCodeClientLimitExceededException "ClientLimitExceededException"
206//   Kinesis Video Streams has throttled the request because you have exceeded
207//   the limit of allowed client calls. Try making the call later.
208//
209//   * ErrCodeNotAuthorizedException "NotAuthorizedException"
210//   Status Code: 403, The caller is not authorized to perform an operation on
211//   the given stream, or the token has expired.
212//
213//   * ErrCodeUnsupportedStreamMediaTypeException "UnsupportedStreamMediaTypeException"
214//   The type of the media (for example, h.264 or h.265 video or ACC or G.711
215//   audio) could not be determined from the codec IDs of the tracks in the first
216//   fragment for a playback session. The codec ID for track 1 should be V_MPEG/ISO/AVC
217//   and, optionally, the codec ID for track 2 should be A_AAC.
218//
219//   * ErrCodeNoDataRetentionException "NoDataRetentionException"
220//   A streaming session was requested for a stream that does not retain data
221//   (that is, has a DataRetentionInHours of 0).
222//
223//   * ErrCodeMissingCodecPrivateDataException "MissingCodecPrivateDataException"
224//   No codec private data was found in at least one of tracks of the video stream.
225//
226//   * ErrCodeInvalidCodecPrivateDataException "InvalidCodecPrivateDataException"
227//   The codec private data in at least one of the tracks of the video stream
228//   is not valid for this operation.
229//
230// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/GetDASHStreamingSessionURL
231func (c *KinesisVideoArchivedMedia) GetDASHStreamingSessionURL(input *GetDASHStreamingSessionURLInput) (*GetDASHStreamingSessionURLOutput, error) {
232	req, out := c.GetDASHStreamingSessionURLRequest(input)
233	return out, req.Send()
234}
235
236// GetDASHStreamingSessionURLWithContext is the same as GetDASHStreamingSessionURL with the addition of
237// the ability to pass a context and additional request options.
238//
239// See GetDASHStreamingSessionURL for details on how to use this API operation.
240//
241// The context must be non-nil and will be used for request cancellation. If
242// the context is nil a panic will occur. In the future the SDK may create
243// sub-contexts for http.Requests. See https://golang.org/pkg/context/
244// for more information on using Contexts.
245func (c *KinesisVideoArchivedMedia) GetDASHStreamingSessionURLWithContext(ctx aws.Context, input *GetDASHStreamingSessionURLInput, opts ...request.Option) (*GetDASHStreamingSessionURLOutput, error) {
246	req, out := c.GetDASHStreamingSessionURLRequest(input)
247	req.SetContext(ctx)
248	req.ApplyOptions(opts...)
249	return out, req.Send()
250}
251
252const opGetHLSStreamingSessionURL = "GetHLSStreamingSessionURL"
253
254// GetHLSStreamingSessionURLRequest generates a "aws/request.Request" representing the
255// client's request for the GetHLSStreamingSessionURL operation. The "output" return
256// value will be populated with the request's response once the request completes
257// successfully.
258//
259// Use "Send" method on the returned Request to send the API call to the service.
260// the "output" return value is not valid until after Send returns without error.
261//
262// See GetHLSStreamingSessionURL for more information on using the GetHLSStreamingSessionURL
263// API call, and error handling.
264//
265// This method is useful when you want to inject custom logic or configuration
266// into the SDK's request lifecycle. Such as custom headers, or retry logic.
267//
268//
269//    // Example sending a request using the GetHLSStreamingSessionURLRequest method.
270//    req, resp := client.GetHLSStreamingSessionURLRequest(params)
271//
272//    err := req.Send()
273//    if err == nil { // resp is now filled
274//        fmt.Println(resp)
275//    }
276//
277// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/GetHLSStreamingSessionURL
278func (c *KinesisVideoArchivedMedia) GetHLSStreamingSessionURLRequest(input *GetHLSStreamingSessionURLInput) (req *request.Request, output *GetHLSStreamingSessionURLOutput) {
279	op := &request.Operation{
280		Name:       opGetHLSStreamingSessionURL,
281		HTTPMethod: "POST",
282		HTTPPath:   "/getHLSStreamingSessionURL",
283	}
284
285	if input == nil {
286		input = &GetHLSStreamingSessionURLInput{}
287	}
288
289	output = &GetHLSStreamingSessionURLOutput{}
290	req = c.newRequest(op, input, output)
291	return
292}
293
294// GetHLSStreamingSessionURL API operation for Amazon Kinesis Video Streams Archived Media.
295//
296// Retrieves an HTTP Live Streaming (HLS) URL for the stream. You can then open
297// the URL in a browser or media player to view the stream contents.
298//
299// Both the StreamName and the StreamARN parameters are optional, but you must
300// specify either the StreamName or the StreamARN when invoking this API operation.
301//
302// An Amazon Kinesis video stream has the following requirements for providing
303// data through HLS:
304//
305//    * The media must contain h.264 or h.265 encoded video and, optionally,
306//    AAC encoded audio. Specifically, the codec ID of track 1 should be V_MPEG/ISO/AVC
307//    (for h.264) or V_MPEG/ISO/HEVC (for h.265). Optionally, the codec ID of
308//    track 2 should be A_AAC.
309//
310//    * Data retention must be greater than 0.
311//
312//    * The video track of each fragment must contain codec private data in
313//    the Advanced Video Coding (AVC) for H.264 format or HEVC for H.265 format
314//    (MPEG-4 specification ISO/IEC 14496-15 (https://www.iso.org/standard/55980.html)).
315//    For information about adapting stream data to a given format, see NAL
316//    Adaptation Flags (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/producer-reference-nal.html).
317//
318//    * The audio track (if present) of each fragment must contain codec private
319//    data in the AAC format (AAC specification ISO/IEC 13818-7 (https://www.iso.org/standard/43345.html)).
320//
321// Kinesis Video Streams HLS sessions contain fragments in the fragmented MPEG-4
322// form (also called fMP4 or CMAF) or the MPEG-2 form (also called TS chunks,
323// which the HLS specification also supports). For more information about HLS
324// fragment types, see the HLS specification (https://tools.ietf.org/html/draft-pantos-http-live-streaming-23).
325//
326// The following procedure shows how to use HLS with Kinesis Video Streams:
327//
328// Get an endpoint using GetDataEndpoint (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_GetDataEndpoint.html),
329// specifying GET_HLS_STREAMING_SESSION_URL for the APIName parameter.
330//
331// Retrieve the HLS URL using GetHLSStreamingSessionURL. Kinesis Video Streams
332// creates an HLS streaming session to be used for accessing content in a stream
333// using the HLS protocol. GetHLSStreamingSessionURL returns an authenticated
334// URL (that includes an encrypted session token) for the session's HLS master
335// playlist (the root resource needed for streaming with HLS).
336//
337// Don't share or store this token where an unauthorized entity could access
338// it. The token provides access to the content of the stream. Safeguard the
339// token with the same measures that you would use with your AWS credentials.
340//
341// The media that is made available through the playlist consists only of the
342// requested stream, time range, and format. No other media data (such as frames
343// outside the requested window or alternate bitrates) is made available.
344//
345// Provide the URL (containing the encrypted session token) for the HLS master
346// playlist to a media player that supports the HLS protocol. Kinesis Video
347// Streams makes the HLS media playlist, initialization fragment, and media
348// fragments available through the master playlist URL. The initialization fragment
349// contains the codec private data for the stream, and other data needed to
350// set up the video or audio decoder and renderer. The media fragments contain
351// H.264-encoded video frames or AAC-encoded audio samples.
352//
353// The media player receives the authenticated URL and requests stream metadata
354// and media data normally. When the media player requests data, it calls the
355// following actions:
356//
357//    * GetHLSMasterPlaylist: Retrieves an HLS master playlist, which contains
358//    a URL for the GetHLSMediaPlaylist action for each track, and additional
359//    metadata for the media player, including estimated bitrate and resolution.
360//
361//    * GetHLSMediaPlaylist: Retrieves an HLS media playlist, which contains
362//    a URL to access the MP4 initialization fragment with the GetMP4InitFragment
363//    action, and URLs to access the MP4 media fragments with the GetMP4MediaFragment
364//    actions. The HLS media playlist also contains metadata about the stream
365//    that the player needs to play it, such as whether the PlaybackMode is
366//    LIVE or ON_DEMAND. The HLS media playlist is typically static for sessions
367//    with a PlaybackType of ON_DEMAND. The HLS media playlist is continually
368//    updated with new fragments for sessions with a PlaybackType of LIVE. There
369//    is a distinct HLS media playlist for the video track and the audio track
370//    (if applicable) that contains MP4 media URLs for the specific track.
371//
372//    * GetMP4InitFragment: Retrieves the MP4 initialization fragment. The media
373//    player typically loads the initialization fragment before loading any
374//    media fragments. This fragment contains the "fytp" and "moov" MP4 atoms,
375//    and the child atoms that are needed to initialize the media player decoder.
376//    The initialization fragment does not correspond to a fragment in a Kinesis
377//    video stream. It contains only the codec private data for the stream and
378//    respective track, which the media player needs to decode the media frames.
379//
380//    * GetMP4MediaFragment: Retrieves MP4 media fragments. These fragments
381//    contain the "moof" and "mdat" MP4 atoms and their child atoms, containing
382//    the encoded fragment's media frames and their timestamps. After the first
383//    media fragment is made available in a streaming session, any fragments
384//    that don't contain the same codec private data cause an error to be returned
385//    when those different media fragments are loaded. Therefore, the codec
386//    private data should not change between fragments in a session. This also
387//    means that the session fails if the fragments in a stream change from
388//    having only video to having both audio and video. Data retrieved with
389//    this action is billable. See Pricing (https://aws.amazon.com/kinesis/video-streams/pricing/)
390//    for details.
391//
392//    * GetTSFragment: Retrieves MPEG TS fragments containing both initialization
393//    and media data for all tracks in the stream. If the ContainerFormat is
394//    MPEG_TS, this API is used instead of GetMP4InitFragment and GetMP4MediaFragment
395//    to retrieve stream media. Data retrieved with this action is billable.
396//    For more information, see Kinesis Video Streams pricing (https://aws.amazon.com/kinesis/video-streams/pricing/).
397//
398// The following restrictions apply to HLS sessions:
399//
400//    * A streaming session URL should not be shared between players. The service
401//    might throttle a session if multiple media players are sharing it. For
402//    connection limits, see Kinesis Video Streams Limits (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/limits.html).
403//
404//    * A Kinesis video stream can have a maximum of ten active HLS streaming
405//    sessions. If a new session is created when the maximum number of sessions
406//    is already active, the oldest (earliest created) session is closed. The
407//    number of active GetMedia connections on a Kinesis video stream does not
408//    count against this limit, and the number of active HLS sessions does not
409//    count against the active GetMedia connection limit. The maximum limits
410//    for active HLS and MPEG-DASH streaming sessions are independent of each
411//    other.
412//
413// You can monitor the amount of data that the media player consumes by monitoring
414// the GetMP4MediaFragment.OutgoingBytes Amazon CloudWatch metric. For information
415// about using CloudWatch to monitor Kinesis Video Streams, see Monitoring Kinesis
416// Video Streams (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/monitoring.html).
417// For pricing information, see Amazon Kinesis Video Streams Pricing (https://aws.amazon.com/kinesis/video-streams/pricing/)
418// and AWS Pricing (https://aws.amazon.com/pricing/). Charges for both HLS sessions
419// and outgoing AWS data apply.
420//
421// For more information about HLS, see HTTP Live Streaming (https://developer.apple.com/streaming/)
422// on the Apple Developer site (https://developer.apple.com).
423//
424// If an error is thrown after invoking a Kinesis Video Streams archived media
425// API, in addition to the HTTP status code and the response body, it includes
426// the following pieces of information:
427//
428//    * x-amz-ErrorType HTTP header – contains a more specific error type
429//    in addition to what the HTTP status code provides.
430//
431//    * x-amz-RequestId HTTP header – if you want to report an issue to AWS,
432//    the support team can better diagnose the problem if given the Request
433//    Id.
434//
435// Both the HTTP status code and the ErrorType header can be utilized to make
436// programmatic decisions about whether errors are retry-able and under what
437// conditions, as well as provide information on what actions the client programmer
438// might need to take in order to successfully try again.
439//
440// For more information, see the Errors section at the bottom of this topic,
441// as well as Common Errors (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/CommonErrors.html).
442//
443// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
444// with awserr.Error's Code and Message methods to get detailed information about
445// the error.
446//
447// See the AWS API reference guide for Amazon Kinesis Video Streams Archived Media's
448// API operation GetHLSStreamingSessionURL for usage and error information.
449//
450// Returned Error Codes:
451//   * ErrCodeResourceNotFoundException "ResourceNotFoundException"
452//   GetMedia throws this error when Kinesis Video Streams can't find the stream
453//   that you specified.
454//
455//   GetHLSStreamingSessionURL and GetDASHStreamingSessionURL throw this error
456//   if a session with a PlaybackMode of ON_DEMAND or LIVE_REPLAYis requested
457//   for a stream that has no fragments within the requested time range, or if
458//   a session with a PlaybackMode of LIVE is requested for a stream that has
459//   no fragments within the last 30 seconds.
460//
461//   * ErrCodeInvalidArgumentException "InvalidArgumentException"
462//   A specified parameter exceeds its restrictions, is not supported, or can't
463//   be used.
464//
465//   * ErrCodeClientLimitExceededException "ClientLimitExceededException"
466//   Kinesis Video Streams has throttled the request because you have exceeded
467//   the limit of allowed client calls. Try making the call later.
468//
469//   * ErrCodeNotAuthorizedException "NotAuthorizedException"
470//   Status Code: 403, The caller is not authorized to perform an operation on
471//   the given stream, or the token has expired.
472//
473//   * ErrCodeUnsupportedStreamMediaTypeException "UnsupportedStreamMediaTypeException"
474//   The type of the media (for example, h.264 or h.265 video or ACC or G.711
475//   audio) could not be determined from the codec IDs of the tracks in the first
476//   fragment for a playback session. The codec ID for track 1 should be V_MPEG/ISO/AVC
477//   and, optionally, the codec ID for track 2 should be A_AAC.
478//
479//   * ErrCodeNoDataRetentionException "NoDataRetentionException"
480//   A streaming session was requested for a stream that does not retain data
481//   (that is, has a DataRetentionInHours of 0).
482//
483//   * ErrCodeMissingCodecPrivateDataException "MissingCodecPrivateDataException"
484//   No codec private data was found in at least one of tracks of the video stream.
485//
486//   * ErrCodeInvalidCodecPrivateDataException "InvalidCodecPrivateDataException"
487//   The codec private data in at least one of the tracks of the video stream
488//   is not valid for this operation.
489//
490// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/GetHLSStreamingSessionURL
491func (c *KinesisVideoArchivedMedia) GetHLSStreamingSessionURL(input *GetHLSStreamingSessionURLInput) (*GetHLSStreamingSessionURLOutput, error) {
492	req, out := c.GetHLSStreamingSessionURLRequest(input)
493	return out, req.Send()
494}
495
496// GetHLSStreamingSessionURLWithContext is the same as GetHLSStreamingSessionURL with the addition of
497// the ability to pass a context and additional request options.
498//
499// See GetHLSStreamingSessionURL for details on how to use this API operation.
500//
501// The context must be non-nil and will be used for request cancellation. If
502// the context is nil a panic will occur. In the future the SDK may create
503// sub-contexts for http.Requests. See https://golang.org/pkg/context/
504// for more information on using Contexts.
505func (c *KinesisVideoArchivedMedia) GetHLSStreamingSessionURLWithContext(ctx aws.Context, input *GetHLSStreamingSessionURLInput, opts ...request.Option) (*GetHLSStreamingSessionURLOutput, error) {
506	req, out := c.GetHLSStreamingSessionURLRequest(input)
507	req.SetContext(ctx)
508	req.ApplyOptions(opts...)
509	return out, req.Send()
510}
511
512const opGetMediaForFragmentList = "GetMediaForFragmentList"
513
514// GetMediaForFragmentListRequest generates a "aws/request.Request" representing the
515// client's request for the GetMediaForFragmentList operation. The "output" return
516// value will be populated with the request's response once the request completes
517// successfully.
518//
519// Use "Send" method on the returned Request to send the API call to the service.
520// the "output" return value is not valid until after Send returns without error.
521//
522// See GetMediaForFragmentList for more information on using the GetMediaForFragmentList
523// API call, and error handling.
524//
525// This method is useful when you want to inject custom logic or configuration
526// into the SDK's request lifecycle. Such as custom headers, or retry logic.
527//
528//
529//    // Example sending a request using the GetMediaForFragmentListRequest method.
530//    req, resp := client.GetMediaForFragmentListRequest(params)
531//
532//    err := req.Send()
533//    if err == nil { // resp is now filled
534//        fmt.Println(resp)
535//    }
536//
537// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/GetMediaForFragmentList
538func (c *KinesisVideoArchivedMedia) GetMediaForFragmentListRequest(input *GetMediaForFragmentListInput) (req *request.Request, output *GetMediaForFragmentListOutput) {
539	op := &request.Operation{
540		Name:       opGetMediaForFragmentList,
541		HTTPMethod: "POST",
542		HTTPPath:   "/getMediaForFragmentList",
543	}
544
545	if input == nil {
546		input = &GetMediaForFragmentListInput{}
547	}
548
549	output = &GetMediaForFragmentListOutput{}
550	req = c.newRequest(op, input, output)
551	return
552}
553
554// GetMediaForFragmentList API operation for Amazon Kinesis Video Streams Archived Media.
555//
556// Gets media for a list of fragments (specified by fragment number) from the
557// archived data in an Amazon Kinesis video stream.
558//
559// You must first call the GetDataEndpoint API to get an endpoint. Then send
560// the GetMediaForFragmentList requests to this endpoint using the --endpoint-url
561// parameter (https://docs.aws.amazon.com/cli/latest/reference/).
562//
563// The following limits apply when using the GetMediaForFragmentList API:
564//
565//    * A client can call GetMediaForFragmentList up to five times per second
566//    per stream.
567//
568//    * Kinesis Video Streams sends media data at a rate of up to 25 megabytes
569//    per second (or 200 megabits per second) during a GetMediaForFragmentList
570//    session.
571//
572// If an error is thrown after invoking a Kinesis Video Streams archived media
573// API, in addition to the HTTP status code and the response body, it includes
574// the following pieces of information:
575//
576//    * x-amz-ErrorType HTTP header – contains a more specific error type
577//    in addition to what the HTTP status code provides.
578//
579//    * x-amz-RequestId HTTP header – if you want to report an issue to AWS,
580//    the support team can better diagnose the problem if given the Request
581//    Id.
582//
583// Both the HTTP status code and the ErrorType header can be utilized to make
584// programmatic decisions about whether errors are retry-able and under what
585// conditions, as well as provide information on what actions the client programmer
586// might need to take in order to successfully try again.
587//
588// For more information, see the Errors section at the bottom of this topic,
589// as well as Common Errors (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/CommonErrors.html).
590//
591// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
592// with awserr.Error's Code and Message methods to get detailed information about
593// the error.
594//
595// See the AWS API reference guide for Amazon Kinesis Video Streams Archived Media's
596// API operation GetMediaForFragmentList for usage and error information.
597//
598// Returned Error Codes:
599//   * ErrCodeResourceNotFoundException "ResourceNotFoundException"
600//   GetMedia throws this error when Kinesis Video Streams can't find the stream
601//   that you specified.
602//
603//   GetHLSStreamingSessionURL and GetDASHStreamingSessionURL throw this error
604//   if a session with a PlaybackMode of ON_DEMAND or LIVE_REPLAYis requested
605//   for a stream that has no fragments within the requested time range, or if
606//   a session with a PlaybackMode of LIVE is requested for a stream that has
607//   no fragments within the last 30 seconds.
608//
609//   * ErrCodeInvalidArgumentException "InvalidArgumentException"
610//   A specified parameter exceeds its restrictions, is not supported, or can't
611//   be used.
612//
613//   * ErrCodeClientLimitExceededException "ClientLimitExceededException"
614//   Kinesis Video Streams has throttled the request because you have exceeded
615//   the limit of allowed client calls. Try making the call later.
616//
617//   * ErrCodeNotAuthorizedException "NotAuthorizedException"
618//   Status Code: 403, The caller is not authorized to perform an operation on
619//   the given stream, or the token has expired.
620//
621// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/GetMediaForFragmentList
622func (c *KinesisVideoArchivedMedia) GetMediaForFragmentList(input *GetMediaForFragmentListInput) (*GetMediaForFragmentListOutput, error) {
623	req, out := c.GetMediaForFragmentListRequest(input)
624	return out, req.Send()
625}
626
627// GetMediaForFragmentListWithContext is the same as GetMediaForFragmentList with the addition of
628// the ability to pass a context and additional request options.
629//
630// See GetMediaForFragmentList for details on how to use this API operation.
631//
632// The context must be non-nil and will be used for request cancellation. If
633// the context is nil a panic will occur. In the future the SDK may create
634// sub-contexts for http.Requests. See https://golang.org/pkg/context/
635// for more information on using Contexts.
636func (c *KinesisVideoArchivedMedia) GetMediaForFragmentListWithContext(ctx aws.Context, input *GetMediaForFragmentListInput, opts ...request.Option) (*GetMediaForFragmentListOutput, error) {
637	req, out := c.GetMediaForFragmentListRequest(input)
638	req.SetContext(ctx)
639	req.ApplyOptions(opts...)
640	return out, req.Send()
641}
642
643const opListFragments = "ListFragments"
644
645// ListFragmentsRequest generates a "aws/request.Request" representing the
646// client's request for the ListFragments operation. The "output" return
647// value will be populated with the request's response once the request completes
648// successfully.
649//
650// Use "Send" method on the returned Request to send the API call to the service.
651// the "output" return value is not valid until after Send returns without error.
652//
653// See ListFragments for more information on using the ListFragments
654// API call, and error handling.
655//
656// This method is useful when you want to inject custom logic or configuration
657// into the SDK's request lifecycle. Such as custom headers, or retry logic.
658//
659//
660//    // Example sending a request using the ListFragmentsRequest method.
661//    req, resp := client.ListFragmentsRequest(params)
662//
663//    err := req.Send()
664//    if err == nil { // resp is now filled
665//        fmt.Println(resp)
666//    }
667//
668// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/ListFragments
669func (c *KinesisVideoArchivedMedia) ListFragmentsRequest(input *ListFragmentsInput) (req *request.Request, output *ListFragmentsOutput) {
670	op := &request.Operation{
671		Name:       opListFragments,
672		HTTPMethod: "POST",
673		HTTPPath:   "/listFragments",
674		Paginator: &request.Paginator{
675			InputTokens:     []string{"NextToken"},
676			OutputTokens:    []string{"NextToken"},
677			LimitToken:      "MaxResults",
678			TruncationToken: "",
679		},
680	}
681
682	if input == nil {
683		input = &ListFragmentsInput{}
684	}
685
686	output = &ListFragmentsOutput{}
687	req = c.newRequest(op, input, output)
688	return
689}
690
691// ListFragments API operation for Amazon Kinesis Video Streams Archived Media.
692//
693// Returns a list of Fragment objects from the specified stream and timestamp
694// range within the archived data.
695//
696// Listing fragments is eventually consistent. This means that even if the producer
697// receives an acknowledgment that a fragment is persisted, the result might
698// not be returned immediately from a request to ListFragments. However, results
699// are typically available in less than one second.
700//
701// You must first call the GetDataEndpoint API to get an endpoint. Then send
702// the ListFragments requests to this endpoint using the --endpoint-url parameter
703// (https://docs.aws.amazon.com/cli/latest/reference/).
704//
705// If an error is thrown after invoking a Kinesis Video Streams archived media
706// API, in addition to the HTTP status code and the response body, it includes
707// the following pieces of information:
708//
709//    * x-amz-ErrorType HTTP header – contains a more specific error type
710//    in addition to what the HTTP status code provides.
711//
712//    * x-amz-RequestId HTTP header – if you want to report an issue to AWS,
713//    the support team can better diagnose the problem if given the Request
714//    Id.
715//
716// Both the HTTP status code and the ErrorType header can be utilized to make
717// programmatic decisions about whether errors are retry-able and under what
718// conditions, as well as provide information on what actions the client programmer
719// might need to take in order to successfully try again.
720//
721// For more information, see the Errors section at the bottom of this topic,
722// as well as Common Errors (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/CommonErrors.html).
723//
724// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
725// with awserr.Error's Code and Message methods to get detailed information about
726// the error.
727//
728// See the AWS API reference guide for Amazon Kinesis Video Streams Archived Media's
729// API operation ListFragments for usage and error information.
730//
731// Returned Error Codes:
732//   * ErrCodeResourceNotFoundException "ResourceNotFoundException"
733//   GetMedia throws this error when Kinesis Video Streams can't find the stream
734//   that you specified.
735//
736//   GetHLSStreamingSessionURL and GetDASHStreamingSessionURL throw this error
737//   if a session with a PlaybackMode of ON_DEMAND or LIVE_REPLAYis requested
738//   for a stream that has no fragments within the requested time range, or if
739//   a session with a PlaybackMode of LIVE is requested for a stream that has
740//   no fragments within the last 30 seconds.
741//
742//   * ErrCodeInvalidArgumentException "InvalidArgumentException"
743//   A specified parameter exceeds its restrictions, is not supported, or can't
744//   be used.
745//
746//   * ErrCodeClientLimitExceededException "ClientLimitExceededException"
747//   Kinesis Video Streams has throttled the request because you have exceeded
748//   the limit of allowed client calls. Try making the call later.
749//
750//   * ErrCodeNotAuthorizedException "NotAuthorizedException"
751//   Status Code: 403, The caller is not authorized to perform an operation on
752//   the given stream, or the token has expired.
753//
754// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/ListFragments
755func (c *KinesisVideoArchivedMedia) ListFragments(input *ListFragmentsInput) (*ListFragmentsOutput, error) {
756	req, out := c.ListFragmentsRequest(input)
757	return out, req.Send()
758}
759
760// ListFragmentsWithContext is the same as ListFragments with the addition of
761// the ability to pass a context and additional request options.
762//
763// See ListFragments for details on how to use this API operation.
764//
765// The context must be non-nil and will be used for request cancellation. If
766// the context is nil a panic will occur. In the future the SDK may create
767// sub-contexts for http.Requests. See https://golang.org/pkg/context/
768// for more information on using Contexts.
769func (c *KinesisVideoArchivedMedia) ListFragmentsWithContext(ctx aws.Context, input *ListFragmentsInput, opts ...request.Option) (*ListFragmentsOutput, error) {
770	req, out := c.ListFragmentsRequest(input)
771	req.SetContext(ctx)
772	req.ApplyOptions(opts...)
773	return out, req.Send()
774}
775
776// ListFragmentsPages iterates over the pages of a ListFragments operation,
777// calling the "fn" function with the response data for each page. To stop
778// iterating, return false from the fn function.
779//
780// See ListFragments method for more information on how to use this operation.
781//
782// Note: This operation can generate multiple requests to a service.
783//
784//    // Example iterating over at most 3 pages of a ListFragments operation.
785//    pageNum := 0
786//    err := client.ListFragmentsPages(params,
787//        func(page *kinesisvideoarchivedmedia.ListFragmentsOutput, lastPage bool) bool {
788//            pageNum++
789//            fmt.Println(page)
790//            return pageNum <= 3
791//        })
792//
793func (c *KinesisVideoArchivedMedia) ListFragmentsPages(input *ListFragmentsInput, fn func(*ListFragmentsOutput, bool) bool) error {
794	return c.ListFragmentsPagesWithContext(aws.BackgroundContext(), input, fn)
795}
796
797// ListFragmentsPagesWithContext same as ListFragmentsPages except
798// it takes a Context and allows setting request options on the pages.
799//
800// The context must be non-nil and will be used for request cancellation. If
801// the context is nil a panic will occur. In the future the SDK may create
802// sub-contexts for http.Requests. See https://golang.org/pkg/context/
803// for more information on using Contexts.
804func (c *KinesisVideoArchivedMedia) ListFragmentsPagesWithContext(ctx aws.Context, input *ListFragmentsInput, fn func(*ListFragmentsOutput, bool) bool, opts ...request.Option) error {
805	p := request.Pagination{
806		NewRequest: func() (*request.Request, error) {
807			var inCpy *ListFragmentsInput
808			if input != nil {
809				tmp := *input
810				inCpy = &tmp
811			}
812			req, _ := c.ListFragmentsRequest(inCpy)
813			req.SetContext(ctx)
814			req.ApplyOptions(opts...)
815			return req, nil
816		},
817	}
818
819	for p.Next() {
820		if !fn(p.Page().(*ListFragmentsOutput), !p.HasNextPage()) {
821			break
822		}
823	}
824
825	return p.Err()
826}
827
828// Contains the range of timestamps for the requested media, and the source
829// of the timestamps.
830type DASHFragmentSelector struct {
831	_ struct{} `type:"structure"`
832
833	// The source of the timestamps for the requested media.
834	//
835	// When FragmentSelectorType is set to PRODUCER_TIMESTAMP and GetDASHStreamingSessionURLInput$PlaybackMode
836	// is ON_DEMAND or LIVE_REPLAY, the first fragment ingested with a producer
837	// timestamp within the specified FragmentSelector$TimestampRange is included
838	// in the media playlist. In addition, the fragments with producer timestamps
839	// within the TimestampRange ingested immediately following the first fragment
840	// (up to the GetDASHStreamingSessionURLInput$MaxManifestFragmentResults value)
841	// are included.
842	//
843	// Fragments that have duplicate producer timestamps are deduplicated. This
844	// means that if producers are producing a stream of fragments with producer
845	// timestamps that are approximately equal to the true clock time, the MPEG-DASH
846	// manifest will contain all of the fragments within the requested timestamp
847	// range. If some fragments are ingested within the same time range and very
848	// different points in time, only the oldest ingested collection of fragments
849	// are returned.
850	//
851	// When FragmentSelectorType is set to PRODUCER_TIMESTAMP and GetDASHStreamingSessionURLInput$PlaybackMode
852	// is LIVE, the producer timestamps are used in the MP4 fragments and for deduplication.
853	// But the most recently ingested fragments based on server timestamps are included
854	// in the MPEG-DASH manifest. This means that even if fragments ingested in
855	// the past have producer timestamps with values now, they are not included
856	// in the HLS media playlist.
857	//
858	// The default is SERVER_TIMESTAMP.
859	FragmentSelectorType *string `type:"string" enum:"DASHFragmentSelectorType"`
860
861	// The start and end of the timestamp range for the requested media.
862	//
863	// This value should not be present if PlaybackType is LIVE.
864	TimestampRange *DASHTimestampRange `type:"structure"`
865}
866
867// String returns the string representation
868func (s DASHFragmentSelector) String() string {
869	return awsutil.Prettify(s)
870}
871
872// GoString returns the string representation
873func (s DASHFragmentSelector) GoString() string {
874	return s.String()
875}
876
877// SetFragmentSelectorType sets the FragmentSelectorType field's value.
878func (s *DASHFragmentSelector) SetFragmentSelectorType(v string) *DASHFragmentSelector {
879	s.FragmentSelectorType = &v
880	return s
881}
882
883// SetTimestampRange sets the TimestampRange field's value.
884func (s *DASHFragmentSelector) SetTimestampRange(v *DASHTimestampRange) *DASHFragmentSelector {
885	s.TimestampRange = v
886	return s
887}
888
889// The start and end of the timestamp range for the requested media.
890//
891// This value should not be present if PlaybackType is LIVE.
892//
893// The values in the DASHimestampRange are inclusive. Fragments that begin before
894// the start time but continue past it, or fragments that begin before the end
895// time but continue past it, are included in the session.
896type DASHTimestampRange struct {
897	_ struct{} `type:"structure"`
898
899	// The end of the timestamp range for the requested media. This value must be
900	// within 3 hours of the specified StartTimestamp, and it must be later than
901	// the StartTimestamp value.
902	//
903	// If FragmentSelectorType for the request is SERVER_TIMESTAMP, this value must
904	// be in the past.
905	//
906	// The EndTimestamp value is required for ON_DEMAND mode, but optional for LIVE_REPLAY
907	// mode. If the EndTimestamp is not set for LIVE_REPLAY mode then the session
908	// will continue to include newly ingested fragments until the session expires.
909	//
910	// This value is inclusive. The EndTimestamp is compared to the (starting) timestamp
911	// of the fragment. Fragments that start before the EndTimestamp value and continue
912	// past it are included in the session.
913	EndTimestamp *time.Time `type:"timestamp"`
914
915	// The start of the timestamp range for the requested media.
916	//
917	// If the DASHTimestampRange value is specified, the StartTimestamp value is
918	// required.
919	//
920	// This value is inclusive. Fragments that start before the StartTimestamp and
921	// continue past it are included in the session. If FragmentSelectorType is
922	// SERVER_TIMESTAMP, the StartTimestamp must be later than the stream head.
923	StartTimestamp *time.Time `type:"timestamp"`
924}
925
926// String returns the string representation
927func (s DASHTimestampRange) String() string {
928	return awsutil.Prettify(s)
929}
930
931// GoString returns the string representation
932func (s DASHTimestampRange) GoString() string {
933	return s.String()
934}
935
936// SetEndTimestamp sets the EndTimestamp field's value.
937func (s *DASHTimestampRange) SetEndTimestamp(v time.Time) *DASHTimestampRange {
938	s.EndTimestamp = &v
939	return s
940}
941
942// SetStartTimestamp sets the StartTimestamp field's value.
943func (s *DASHTimestampRange) SetStartTimestamp(v time.Time) *DASHTimestampRange {
944	s.StartTimestamp = &v
945	return s
946}
947
948// Represents a segment of video or other time-delimited data.
949type Fragment struct {
950	_ struct{} `type:"structure"`
951
952	// The playback duration or other time value associated with the fragment.
953	FragmentLengthInMilliseconds *int64 `type:"long"`
954
955	// The unique identifier of the fragment. This value monotonically increases
956	// based on the ingestion order.
957	FragmentNumber *string `min:"1" type:"string"`
958
959	// The total fragment size, including information about the fragment and contained
960	// media data.
961	FragmentSizeInBytes *int64 `type:"long"`
962
963	// The timestamp from the producer corresponding to the fragment.
964	ProducerTimestamp *time.Time `type:"timestamp"`
965
966	// The timestamp from the AWS server corresponding to the fragment.
967	ServerTimestamp *time.Time `type:"timestamp"`
968}
969
970// String returns the string representation
971func (s Fragment) String() string {
972	return awsutil.Prettify(s)
973}
974
975// GoString returns the string representation
976func (s Fragment) GoString() string {
977	return s.String()
978}
979
980// SetFragmentLengthInMilliseconds sets the FragmentLengthInMilliseconds field's value.
981func (s *Fragment) SetFragmentLengthInMilliseconds(v int64) *Fragment {
982	s.FragmentLengthInMilliseconds = &v
983	return s
984}
985
986// SetFragmentNumber sets the FragmentNumber field's value.
987func (s *Fragment) SetFragmentNumber(v string) *Fragment {
988	s.FragmentNumber = &v
989	return s
990}
991
992// SetFragmentSizeInBytes sets the FragmentSizeInBytes field's value.
993func (s *Fragment) SetFragmentSizeInBytes(v int64) *Fragment {
994	s.FragmentSizeInBytes = &v
995	return s
996}
997
998// SetProducerTimestamp sets the ProducerTimestamp field's value.
999func (s *Fragment) SetProducerTimestamp(v time.Time) *Fragment {
1000	s.ProducerTimestamp = &v
1001	return s
1002}
1003
1004// SetServerTimestamp sets the ServerTimestamp field's value.
1005func (s *Fragment) SetServerTimestamp(v time.Time) *Fragment {
1006	s.ServerTimestamp = &v
1007	return s
1008}
1009
1010// Describes the timestamp range and timestamp origin of a range of fragments.
1011//
1012// Only fragments with a start timestamp greater than or equal to the given
1013// start time and less than or equal to the end time are returned. For example,
1014// if a stream contains fragments with the following start timestamps:
1015//
1016//    * 00:00:00
1017//
1018//    * 00:00:02
1019//
1020//    * 00:00:04
1021//
1022//    * 00:00:06
1023//
1024// A fragment selector range with a start time of 00:00:01 and end time of 00:00:04
1025// would return the fragments with start times of 00:00:02 and 00:00:04.
1026type FragmentSelector struct {
1027	_ struct{} `type:"structure"`
1028
1029	// The origin of the timestamps to use (Server or Producer).
1030	//
1031	// FragmentSelectorType is a required field
1032	FragmentSelectorType *string `type:"string" required:"true" enum:"FragmentSelectorType"`
1033
1034	// The range of timestamps to return.
1035	//
1036	// TimestampRange is a required field
1037	TimestampRange *TimestampRange `type:"structure" required:"true"`
1038}
1039
1040// String returns the string representation
1041func (s FragmentSelector) String() string {
1042	return awsutil.Prettify(s)
1043}
1044
1045// GoString returns the string representation
1046func (s FragmentSelector) GoString() string {
1047	return s.String()
1048}
1049
1050// Validate inspects the fields of the type to determine if they are valid.
1051func (s *FragmentSelector) Validate() error {
1052	invalidParams := request.ErrInvalidParams{Context: "FragmentSelector"}
1053	if s.FragmentSelectorType == nil {
1054		invalidParams.Add(request.NewErrParamRequired("FragmentSelectorType"))
1055	}
1056	if s.TimestampRange == nil {
1057		invalidParams.Add(request.NewErrParamRequired("TimestampRange"))
1058	}
1059	if s.TimestampRange != nil {
1060		if err := s.TimestampRange.Validate(); err != nil {
1061			invalidParams.AddNested("TimestampRange", err.(request.ErrInvalidParams))
1062		}
1063	}
1064
1065	if invalidParams.Len() > 0 {
1066		return invalidParams
1067	}
1068	return nil
1069}
1070
1071// SetFragmentSelectorType sets the FragmentSelectorType field's value.
1072func (s *FragmentSelector) SetFragmentSelectorType(v string) *FragmentSelector {
1073	s.FragmentSelectorType = &v
1074	return s
1075}
1076
1077// SetTimestampRange sets the TimestampRange field's value.
1078func (s *FragmentSelector) SetTimestampRange(v *TimestampRange) *FragmentSelector {
1079	s.TimestampRange = v
1080	return s
1081}
1082
1083type GetDASHStreamingSessionURLInput struct {
1084	_ struct{} `type:"structure"`
1085
1086	// The time range of the requested fragment and the source of the timestamps.
1087	//
1088	// This parameter is required if PlaybackMode is ON_DEMAND or LIVE_REPLAY. This
1089	// parameter is optional if PlaybackMode is LIVE. If PlaybackMode is LIVE, the
1090	// FragmentSelectorType can be set, but the TimestampRange should not be set.
1091	// If PlaybackMode is ON_DEMAND or LIVE_REPLAY, both FragmentSelectorType and
1092	// TimestampRange must be set.
1093	DASHFragmentSelector *DASHFragmentSelector `type:"structure"`
1094
1095	// Fragments are identified in the manifest file based on their sequence number
1096	// in the session. If DisplayFragmentNumber is set to ALWAYS, the Kinesis Video
1097	// Streams fragment number is added to each S element in the manifest file with
1098	// the attribute name “kvs:fn”. These fragment numbers can be used for logging
1099	// or for use with other APIs (e.g. GetMedia and GetMediaForFragmentList). A
1100	// custom MPEG-DASH media player is necessary to leverage these this custom
1101	// attribute.
1102	//
1103	// The default value is NEVER.
1104	DisplayFragmentNumber *string `type:"string" enum:"DASHDisplayFragmentNumber"`
1105
1106	// Per the MPEG-DASH specification, the wall-clock time of fragments in the
1107	// manifest file can be derived using attributes in the manifest itself. However,
1108	// typically, MPEG-DASH compatible media players do not properly handle gaps
1109	// in the media timeline. Kinesis Video Streams adjusts the media timeline in
1110	// the manifest file to enable playback of media with discontinuities. Therefore,
1111	// the wall-clock time derived from the manifest file may be inaccurate. If
1112	// DisplayFragmentTimestamp is set to ALWAYS, the accurate fragment timestamp
1113	// is added to each S element in the manifest file with the attribute name “kvs:ts”.
1114	// A custom MPEG-DASH media player is necessary to leverage this custom attribute.
1115	//
1116	// The default value is NEVER. When DASHFragmentSelector is SERVER_TIMESTAMP,
1117	// the timestamps will be the server start timestamps. Similarly, when DASHFragmentSelector
1118	// is PRODUCER_TIMESTAMP, the timestamps will be the producer start timestamps.
1119	DisplayFragmentTimestamp *string `type:"string" enum:"DASHDisplayFragmentTimestamp"`
1120
1121	// The time in seconds until the requested session expires. This value can be
1122	// between 300 (5 minutes) and 43200 (12 hours).
1123	//
1124	// When a session expires, no new calls to GetDashManifest, GetMP4InitFragment,
1125	// or GetMP4MediaFragment can be made for that session.
1126	//
1127	// The default is 300 (5 minutes).
1128	Expires *int64 `min:"300" type:"integer"`
1129
1130	// The maximum number of fragments that are returned in the MPEG-DASH manifest.
1131	//
1132	// When the PlaybackMode is LIVE, the most recent fragments are returned up
1133	// to this value. When the PlaybackMode is ON_DEMAND, the oldest fragments are
1134	// returned, up to this maximum number.
1135	//
1136	// When there are a higher number of fragments available in a live MPEG-DASH
1137	// manifest, video players often buffer content before starting playback. Increasing
1138	// the buffer size increases the playback latency, but it decreases the likelihood
1139	// that rebuffering will occur during playback. We recommend that a live MPEG-DASH
1140	// manifest have a minimum of 3 fragments and a maximum of 10 fragments.
1141	//
1142	// The default is 5 fragments if PlaybackMode is LIVE or LIVE_REPLAY, and 1,000
1143	// if PlaybackMode is ON_DEMAND.
1144	//
1145	// The maximum value of 1,000 fragments corresponds to more than 16 minutes
1146	// of video on streams with 1-second fragments, and more than 2 1/2 hours of
1147	// video on streams with 10-second fragments.
1148	MaxManifestFragmentResults *int64 `min:"1" type:"long"`
1149
1150	// Whether to retrieve live, live replay, or archived, on-demand data.
1151	//
1152	// Features of the three types of sessions include the following:
1153	//
1154	//    * LIVE : For sessions of this type, the MPEG-DASH manifest is continually
1155	//    updated with the latest fragments as they become available. We recommend
1156	//    that the media player retrieve a new manifest on a one-second interval.
1157	//    When this type of session is played in a media player, the user interface
1158	//    typically displays a "live" notification, with no scrubber control for
1159	//    choosing the position in the playback window to display. In LIVE mode,
1160	//    the newest available fragments are included in an MPEG-DASH manifest,
1161	//    even if there is a gap between fragments (that is, if a fragment is missing).
1162	//    A gap like this might cause a media player to halt or cause a jump in
1163	//    playback. In this mode, fragments are not added to the MPEG-DASH manifest
1164	//    if they are older than the newest fragment in the playlist. If the missing
1165	//    fragment becomes available after a subsequent fragment is added to the
1166	//    manifest, the older fragment is not added, and the gap is not filled.
1167	//
1168	//    * LIVE_REPLAY : For sessions of this type, the MPEG-DASH manifest is updated
1169	//    similarly to how it is updated for LIVE mode except that it starts by
1170	//    including fragments from a given start time. Instead of fragments being
1171	//    added as they are ingested, fragments are added as the duration of the
1172	//    next fragment elapses. For example, if the fragments in the session are
1173	//    two seconds long, then a new fragment is added to the manifest every two
1174	//    seconds. This mode is useful to be able to start playback from when an
1175	//    event is detected and continue live streaming media that has not yet been
1176	//    ingested as of the time of the session creation. This mode is also useful
1177	//    to stream previously archived media without being limited by the 1,000
1178	//    fragment limit in the ON_DEMAND mode.
1179	//
1180	//    * ON_DEMAND : For sessions of this type, the MPEG-DASH manifest contains
1181	//    all the fragments for the session, up to the number that is specified
1182	//    in MaxMediaPlaylistFragmentResults. The manifest must be retrieved only
1183	//    once for each session. When this type of session is played in a media
1184	//    player, the user interface typically displays a scrubber control for choosing
1185	//    the position in the playback window to display.
1186	//
1187	// In all playback modes, if FragmentSelectorType is PRODUCER_TIMESTAMP, and
1188	// if there are multiple fragments with the same start timestamp, the fragment
1189	// that has the larger fragment number (that is, the newer fragment) is included
1190	// in the MPEG-DASH manifest. The other fragments are not included. Fragments
1191	// that have different timestamps but have overlapping durations are still included
1192	// in the MPEG-DASH manifest. This can lead to unexpected behavior in the media
1193	// player.
1194	//
1195	// The default is LIVE.
1196	PlaybackMode *string `type:"string" enum:"DASHPlaybackMode"`
1197
1198	// The Amazon Resource Name (ARN) of the stream for which to retrieve the MPEG-DASH
1199	// manifest URL.
1200	//
1201	// You must specify either the StreamName or the StreamARN.
1202	StreamARN *string `min:"1" type:"string"`
1203
1204	// The name of the stream for which to retrieve the MPEG-DASH manifest URL.
1205	//
1206	// You must specify either the StreamName or the StreamARN.
1207	StreamName *string `min:"1" type:"string"`
1208}
1209
1210// String returns the string representation
1211func (s GetDASHStreamingSessionURLInput) String() string {
1212	return awsutil.Prettify(s)
1213}
1214
1215// GoString returns the string representation
1216func (s GetDASHStreamingSessionURLInput) GoString() string {
1217	return s.String()
1218}
1219
1220// Validate inspects the fields of the type to determine if they are valid.
1221func (s *GetDASHStreamingSessionURLInput) Validate() error {
1222	invalidParams := request.ErrInvalidParams{Context: "GetDASHStreamingSessionURLInput"}
1223	if s.Expires != nil && *s.Expires < 300 {
1224		invalidParams.Add(request.NewErrParamMinValue("Expires", 300))
1225	}
1226	if s.MaxManifestFragmentResults != nil && *s.MaxManifestFragmentResults < 1 {
1227		invalidParams.Add(request.NewErrParamMinValue("MaxManifestFragmentResults", 1))
1228	}
1229	if s.StreamARN != nil && len(*s.StreamARN) < 1 {
1230		invalidParams.Add(request.NewErrParamMinLen("StreamARN", 1))
1231	}
1232	if s.StreamName != nil && len(*s.StreamName) < 1 {
1233		invalidParams.Add(request.NewErrParamMinLen("StreamName", 1))
1234	}
1235
1236	if invalidParams.Len() > 0 {
1237		return invalidParams
1238	}
1239	return nil
1240}
1241
1242// SetDASHFragmentSelector sets the DASHFragmentSelector field's value.
1243func (s *GetDASHStreamingSessionURLInput) SetDASHFragmentSelector(v *DASHFragmentSelector) *GetDASHStreamingSessionURLInput {
1244	s.DASHFragmentSelector = v
1245	return s
1246}
1247
1248// SetDisplayFragmentNumber sets the DisplayFragmentNumber field's value.
1249func (s *GetDASHStreamingSessionURLInput) SetDisplayFragmentNumber(v string) *GetDASHStreamingSessionURLInput {
1250	s.DisplayFragmentNumber = &v
1251	return s
1252}
1253
1254// SetDisplayFragmentTimestamp sets the DisplayFragmentTimestamp field's value.
1255func (s *GetDASHStreamingSessionURLInput) SetDisplayFragmentTimestamp(v string) *GetDASHStreamingSessionURLInput {
1256	s.DisplayFragmentTimestamp = &v
1257	return s
1258}
1259
1260// SetExpires sets the Expires field's value.
1261func (s *GetDASHStreamingSessionURLInput) SetExpires(v int64) *GetDASHStreamingSessionURLInput {
1262	s.Expires = &v
1263	return s
1264}
1265
1266// SetMaxManifestFragmentResults sets the MaxManifestFragmentResults field's value.
1267func (s *GetDASHStreamingSessionURLInput) SetMaxManifestFragmentResults(v int64) *GetDASHStreamingSessionURLInput {
1268	s.MaxManifestFragmentResults = &v
1269	return s
1270}
1271
1272// SetPlaybackMode sets the PlaybackMode field's value.
1273func (s *GetDASHStreamingSessionURLInput) SetPlaybackMode(v string) *GetDASHStreamingSessionURLInput {
1274	s.PlaybackMode = &v
1275	return s
1276}
1277
1278// SetStreamARN sets the StreamARN field's value.
1279func (s *GetDASHStreamingSessionURLInput) SetStreamARN(v string) *GetDASHStreamingSessionURLInput {
1280	s.StreamARN = &v
1281	return s
1282}
1283
1284// SetStreamName sets the StreamName field's value.
1285func (s *GetDASHStreamingSessionURLInput) SetStreamName(v string) *GetDASHStreamingSessionURLInput {
1286	s.StreamName = &v
1287	return s
1288}
1289
1290type GetDASHStreamingSessionURLOutput struct {
1291	_ struct{} `type:"structure"`
1292
1293	// The URL (containing the session token) that a media player can use to retrieve
1294	// the MPEG-DASH manifest.
1295	DASHStreamingSessionURL *string `type:"string"`
1296}
1297
1298// String returns the string representation
1299func (s GetDASHStreamingSessionURLOutput) String() string {
1300	return awsutil.Prettify(s)
1301}
1302
1303// GoString returns the string representation
1304func (s GetDASHStreamingSessionURLOutput) GoString() string {
1305	return s.String()
1306}
1307
1308// SetDASHStreamingSessionURL sets the DASHStreamingSessionURL field's value.
1309func (s *GetDASHStreamingSessionURLOutput) SetDASHStreamingSessionURL(v string) *GetDASHStreamingSessionURLOutput {
1310	s.DASHStreamingSessionURL = &v
1311	return s
1312}
1313
1314type GetHLSStreamingSessionURLInput struct {
1315	_ struct{} `type:"structure"`
1316
1317	// Specifies which format should be used for packaging the media. Specifying
1318	// the FRAGMENTED_MP4 container format packages the media into MP4 fragments
1319	// (fMP4 or CMAF). This is the recommended packaging because there is minimal
1320	// packaging overhead. The other container format option is MPEG_TS. HLS has
1321	// supported MPEG TS chunks since it was released and is sometimes the only
1322	// supported packaging on older HLS players. MPEG TS typically has a 5-25 percent
1323	// packaging overhead. This means MPEG TS typically requires 5-25 percent more
1324	// bandwidth and cost than fMP4.
1325	//
1326	// The default is FRAGMENTED_MP4.
1327	ContainerFormat *string `type:"string" enum:"ContainerFormat"`
1328
1329	// Specifies when flags marking discontinuities between fragments are added
1330	// to the media playlists.
1331	//
1332	// Media players typically build a timeline of media content to play, based
1333	// on the timestamps of each fragment. This means that if there is any overlap
1334	// or gap between fragments (as is typical if HLSFragmentSelector is set to
1335	// SERVER_TIMESTAMP), the media player timeline will also have small gaps between
1336	// fragments in some places, and will overwrite frames in other places. Gaps
1337	// in the media player timeline can cause playback to stall and overlaps can
1338	// cause playback to be jittery. When there are discontinuity flags between
1339	// fragments, the media player is expected to reset the timeline, resulting
1340	// in the next fragment being played immediately after the previous fragment.
1341	//
1342	// The following modes are supported:
1343	//
1344	//    * ALWAYS: a discontinuity marker is placed between every fragment in the
1345	//    HLS media playlist. It is recommended to use a value of ALWAYS if the
1346	//    fragment timestamps are not accurate.
1347	//
1348	//    * NEVER: no discontinuity markers are placed anywhere. It is recommended
1349	//    to use a value of NEVER to ensure the media player timeline most accurately
1350	//    maps to the producer timestamps.
1351	//
1352	//    * ON_DISCONTIUNITY: a discontinuity marker is placed between fragments
1353	//    that have a gap or overlap of more than 50 milliseconds. For most playback
1354	//    scenarios, it is recommended to use a value of ON_DISCONTINUITY so that
1355	//    the media player timeline is only reset when there is a significant issue
1356	//    with the media timeline (e.g. a missing fragment).
1357	//
1358	// The default is ALWAYS when HLSFragmentSelector is set to SERVER_TIMESTAMP,
1359	// and NEVER when it is set to PRODUCER_TIMESTAMP.
1360	DiscontinuityMode *string `type:"string" enum:"HLSDiscontinuityMode"`
1361
1362	// Specifies when the fragment start timestamps should be included in the HLS
1363	// media playlist. Typically, media players report the playhead position as
1364	// a time relative to the start of the first fragment in the playback session.
1365	// However, when the start timestamps are included in the HLS media playlist,
1366	// some media players might report the current playhead as an absolute time
1367	// based on the fragment timestamps. This can be useful for creating a playback
1368	// experience that shows viewers the wall-clock time of the media.
1369	//
1370	// The default is NEVER. When HLSFragmentSelector is SERVER_TIMESTAMP, the timestamps
1371	// will be the server start timestamps. Similarly, when HLSFragmentSelector
1372	// is PRODUCER_TIMESTAMP, the timestamps will be the producer start timestamps.
1373	DisplayFragmentTimestamp *string `type:"string" enum:"HLSDisplayFragmentTimestamp"`
1374
1375	// The time in seconds until the requested session expires. This value can be
1376	// between 300 (5 minutes) and 43200 (12 hours).
1377	//
1378	// When a session expires, no new calls to GetHLSMasterPlaylist, GetHLSMediaPlaylist,
1379	// GetMP4InitFragment, GetMP4MediaFragment, or GetTSFragment can be made for
1380	// that session.
1381	//
1382	// The default is 300 (5 minutes).
1383	Expires *int64 `min:"300" type:"integer"`
1384
1385	// The time range of the requested fragment and the source of the timestamps.
1386	//
1387	// This parameter is required if PlaybackMode is ON_DEMAND or LIVE_REPLAY. This
1388	// parameter is optional if PlaybackMode is LIVE. If PlaybackMode is LIVE, the
1389	// FragmentSelectorType can be set, but the TimestampRange should not be set.
1390	// If PlaybackMode is ON_DEMAND or LIVE_REPLAY, both FragmentSelectorType and
1391	// TimestampRange must be set.
1392	HLSFragmentSelector *HLSFragmentSelector `type:"structure"`
1393
1394	// The maximum number of fragments that are returned in the HLS media playlists.
1395	//
1396	// When the PlaybackMode is LIVE, the most recent fragments are returned up
1397	// to this value. When the PlaybackMode is ON_DEMAND, the oldest fragments are
1398	// returned, up to this maximum number.
1399	//
1400	// When there are a higher number of fragments available in a live HLS media
1401	// playlist, video players often buffer content before starting playback. Increasing
1402	// the buffer size increases the playback latency, but it decreases the likelihood
1403	// that rebuffering will occur during playback. We recommend that a live HLS
1404	// media playlist have a minimum of 3 fragments and a maximum of 10 fragments.
1405	//
1406	// The default is 5 fragments if PlaybackMode is LIVE or LIVE_REPLAY, and 1,000
1407	// if PlaybackMode is ON_DEMAND.
1408	//
1409	// The maximum value of 1,000 fragments corresponds to more than 16 minutes
1410	// of video on streams with 1-second fragments, and more than 2 1/2 hours of
1411	// video on streams with 10-second fragments.
1412	MaxMediaPlaylistFragmentResults *int64 `min:"1" type:"long"`
1413
1414	// Whether to retrieve live, live replay, or archived, on-demand data.
1415	//
1416	// Features of the three types of sessions include the following:
1417	//
1418	//    * LIVE : For sessions of this type, the HLS media playlist is continually
1419	//    updated with the latest fragments as they become available. We recommend
1420	//    that the media player retrieve a new playlist on a one-second interval.
1421	//    When this type of session is played in a media player, the user interface
1422	//    typically displays a "live" notification, with no scrubber control for
1423	//    choosing the position in the playback window to display. In LIVE mode,
1424	//    the newest available fragments are included in an HLS media playlist,
1425	//    even if there is a gap between fragments (that is, if a fragment is missing).
1426	//    A gap like this might cause a media player to halt or cause a jump in
1427	//    playback. In this mode, fragments are not added to the HLS media playlist
1428	//    if they are older than the newest fragment in the playlist. If the missing
1429	//    fragment becomes available after a subsequent fragment is added to the
1430	//    playlist, the older fragment is not added, and the gap is not filled.
1431	//
1432	//    * LIVE_REPLAY : For sessions of this type, the HLS media playlist is updated
1433	//    similarly to how it is updated for LIVE mode except that it starts by
1434	//    including fragments from a given start time. Instead of fragments being
1435	//    added as they are ingested, fragments are added as the duration of the
1436	//    next fragment elapses. For example, if the fragments in the session are
1437	//    two seconds long, then a new fragment is added to the media playlist every
1438	//    two seconds. This mode is useful to be able to start playback from when
1439	//    an event is detected and continue live streaming media that has not yet
1440	//    been ingested as of the time of the session creation. This mode is also
1441	//    useful to stream previously archived media without being limited by the
1442	//    1,000 fragment limit in the ON_DEMAND mode.
1443	//
1444	//    * ON_DEMAND : For sessions of this type, the HLS media playlist contains
1445	//    all the fragments for the session, up to the number that is specified
1446	//    in MaxMediaPlaylistFragmentResults. The playlist must be retrieved only
1447	//    once for each session. When this type of session is played in a media
1448	//    player, the user interface typically displays a scrubber control for choosing
1449	//    the position in the playback window to display.
1450	//
1451	// In all playback modes, if FragmentSelectorType is PRODUCER_TIMESTAMP, and
1452	// if there are multiple fragments with the same start timestamp, the fragment
1453	// that has the larger fragment number (that is, the newer fragment) is included
1454	// in the HLS media playlist. The other fragments are not included. Fragments
1455	// that have different timestamps but have overlapping durations are still included
1456	// in the HLS media playlist. This can lead to unexpected behavior in the media
1457	// player.
1458	//
1459	// The default is LIVE.
1460	PlaybackMode *string `type:"string" enum:"HLSPlaybackMode"`
1461
1462	// The Amazon Resource Name (ARN) of the stream for which to retrieve the HLS
1463	// master playlist URL.
1464	//
1465	// You must specify either the StreamName or the StreamARN.
1466	StreamARN *string `min:"1" type:"string"`
1467
1468	// The name of the stream for which to retrieve the HLS master playlist URL.
1469	//
1470	// You must specify either the StreamName or the StreamARN.
1471	StreamName *string `min:"1" type:"string"`
1472}
1473
1474// String returns the string representation
1475func (s GetHLSStreamingSessionURLInput) String() string {
1476	return awsutil.Prettify(s)
1477}
1478
1479// GoString returns the string representation
1480func (s GetHLSStreamingSessionURLInput) GoString() string {
1481	return s.String()
1482}
1483
1484// Validate inspects the fields of the type to determine if they are valid.
1485func (s *GetHLSStreamingSessionURLInput) Validate() error {
1486	invalidParams := request.ErrInvalidParams{Context: "GetHLSStreamingSessionURLInput"}
1487	if s.Expires != nil && *s.Expires < 300 {
1488		invalidParams.Add(request.NewErrParamMinValue("Expires", 300))
1489	}
1490	if s.MaxMediaPlaylistFragmentResults != nil && *s.MaxMediaPlaylistFragmentResults < 1 {
1491		invalidParams.Add(request.NewErrParamMinValue("MaxMediaPlaylistFragmentResults", 1))
1492	}
1493	if s.StreamARN != nil && len(*s.StreamARN) < 1 {
1494		invalidParams.Add(request.NewErrParamMinLen("StreamARN", 1))
1495	}
1496	if s.StreamName != nil && len(*s.StreamName) < 1 {
1497		invalidParams.Add(request.NewErrParamMinLen("StreamName", 1))
1498	}
1499
1500	if invalidParams.Len() > 0 {
1501		return invalidParams
1502	}
1503	return nil
1504}
1505
1506// SetContainerFormat sets the ContainerFormat field's value.
1507func (s *GetHLSStreamingSessionURLInput) SetContainerFormat(v string) *GetHLSStreamingSessionURLInput {
1508	s.ContainerFormat = &v
1509	return s
1510}
1511
1512// SetDiscontinuityMode sets the DiscontinuityMode field's value.
1513func (s *GetHLSStreamingSessionURLInput) SetDiscontinuityMode(v string) *GetHLSStreamingSessionURLInput {
1514	s.DiscontinuityMode = &v
1515	return s
1516}
1517
1518// SetDisplayFragmentTimestamp sets the DisplayFragmentTimestamp field's value.
1519func (s *GetHLSStreamingSessionURLInput) SetDisplayFragmentTimestamp(v string) *GetHLSStreamingSessionURLInput {
1520	s.DisplayFragmentTimestamp = &v
1521	return s
1522}
1523
1524// SetExpires sets the Expires field's value.
1525func (s *GetHLSStreamingSessionURLInput) SetExpires(v int64) *GetHLSStreamingSessionURLInput {
1526	s.Expires = &v
1527	return s
1528}
1529
1530// SetHLSFragmentSelector sets the HLSFragmentSelector field's value.
1531func (s *GetHLSStreamingSessionURLInput) SetHLSFragmentSelector(v *HLSFragmentSelector) *GetHLSStreamingSessionURLInput {
1532	s.HLSFragmentSelector = v
1533	return s
1534}
1535
1536// SetMaxMediaPlaylistFragmentResults sets the MaxMediaPlaylistFragmentResults field's value.
1537func (s *GetHLSStreamingSessionURLInput) SetMaxMediaPlaylistFragmentResults(v int64) *GetHLSStreamingSessionURLInput {
1538	s.MaxMediaPlaylistFragmentResults = &v
1539	return s
1540}
1541
1542// SetPlaybackMode sets the PlaybackMode field's value.
1543func (s *GetHLSStreamingSessionURLInput) SetPlaybackMode(v string) *GetHLSStreamingSessionURLInput {
1544	s.PlaybackMode = &v
1545	return s
1546}
1547
1548// SetStreamARN sets the StreamARN field's value.
1549func (s *GetHLSStreamingSessionURLInput) SetStreamARN(v string) *GetHLSStreamingSessionURLInput {
1550	s.StreamARN = &v
1551	return s
1552}
1553
1554// SetStreamName sets the StreamName field's value.
1555func (s *GetHLSStreamingSessionURLInput) SetStreamName(v string) *GetHLSStreamingSessionURLInput {
1556	s.StreamName = &v
1557	return s
1558}
1559
1560type GetHLSStreamingSessionURLOutput struct {
1561	_ struct{} `type:"structure"`
1562
1563	// The URL (containing the session token) that a media player can use to retrieve
1564	// the HLS master playlist.
1565	HLSStreamingSessionURL *string `type:"string"`
1566}
1567
1568// String returns the string representation
1569func (s GetHLSStreamingSessionURLOutput) String() string {
1570	return awsutil.Prettify(s)
1571}
1572
1573// GoString returns the string representation
1574func (s GetHLSStreamingSessionURLOutput) GoString() string {
1575	return s.String()
1576}
1577
1578// SetHLSStreamingSessionURL sets the HLSStreamingSessionURL field's value.
1579func (s *GetHLSStreamingSessionURLOutput) SetHLSStreamingSessionURL(v string) *GetHLSStreamingSessionURLOutput {
1580	s.HLSStreamingSessionURL = &v
1581	return s
1582}
1583
1584type GetMediaForFragmentListInput struct {
1585	_ struct{} `type:"structure"`
1586
1587	// A list of the numbers of fragments for which to retrieve media. You retrieve
1588	// these values with ListFragments.
1589	//
1590	// Fragments is a required field
1591	Fragments []*string `min:"1" type:"list" required:"true"`
1592
1593	// The name of the stream from which to retrieve fragment media.
1594	//
1595	// StreamName is a required field
1596	StreamName *string `min:"1" type:"string" required:"true"`
1597}
1598
1599// String returns the string representation
1600func (s GetMediaForFragmentListInput) String() string {
1601	return awsutil.Prettify(s)
1602}
1603
1604// GoString returns the string representation
1605func (s GetMediaForFragmentListInput) GoString() string {
1606	return s.String()
1607}
1608
1609// Validate inspects the fields of the type to determine if they are valid.
1610func (s *GetMediaForFragmentListInput) Validate() error {
1611	invalidParams := request.ErrInvalidParams{Context: "GetMediaForFragmentListInput"}
1612	if s.Fragments == nil {
1613		invalidParams.Add(request.NewErrParamRequired("Fragments"))
1614	}
1615	if s.Fragments != nil && len(s.Fragments) < 1 {
1616		invalidParams.Add(request.NewErrParamMinLen("Fragments", 1))
1617	}
1618	if s.StreamName == nil {
1619		invalidParams.Add(request.NewErrParamRequired("StreamName"))
1620	}
1621	if s.StreamName != nil && len(*s.StreamName) < 1 {
1622		invalidParams.Add(request.NewErrParamMinLen("StreamName", 1))
1623	}
1624
1625	if invalidParams.Len() > 0 {
1626		return invalidParams
1627	}
1628	return nil
1629}
1630
1631// SetFragments sets the Fragments field's value.
1632func (s *GetMediaForFragmentListInput) SetFragments(v []*string) *GetMediaForFragmentListInput {
1633	s.Fragments = v
1634	return s
1635}
1636
1637// SetStreamName sets the StreamName field's value.
1638func (s *GetMediaForFragmentListInput) SetStreamName(v string) *GetMediaForFragmentListInput {
1639	s.StreamName = &v
1640	return s
1641}
1642
1643type GetMediaForFragmentListOutput struct {
1644	_ struct{} `type:"structure" payload:"Payload"`
1645
1646	// The content type of the requested media.
1647	ContentType *string `location:"header" locationName:"Content-Type" min:"1" type:"string"`
1648
1649	// The payload that Kinesis Video Streams returns is a sequence of chunks from
1650	// the specified stream. For information about the chunks, see PutMedia (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_dataplane_PutMedia.html).
1651	// The chunks that Kinesis Video Streams returns in the GetMediaForFragmentList
1652	// call also include the following additional Matroska (MKV) tags:
1653	//
1654	//    * AWS_KINESISVIDEO_FRAGMENT_NUMBER - Fragment number returned in the chunk.
1655	//
1656	//    * AWS_KINESISVIDEO_SERVER_SIDE_TIMESTAMP - Server-side timestamp of the
1657	//    fragment.
1658	//
1659	//    * AWS_KINESISVIDEO_PRODUCER_SIDE_TIMESTAMP - Producer-side timestamp of
1660	//    the fragment.
1661	//
1662	// The following tags will be included if an exception occurs:
1663	//
1664	//    * AWS_KINESISVIDEO_FRAGMENT_NUMBER - The number of the fragment that threw
1665	//    the exception
1666	//
1667	//    * AWS_KINESISVIDEO_EXCEPTION_ERROR_CODE - The integer code of the exception
1668	//
1669	//    * AWS_KINESISVIDEO_EXCEPTION_MESSAGE - A text description of the exception
1670	Payload io.ReadCloser `type:"blob"`
1671}
1672
1673// String returns the string representation
1674func (s GetMediaForFragmentListOutput) String() string {
1675	return awsutil.Prettify(s)
1676}
1677
1678// GoString returns the string representation
1679func (s GetMediaForFragmentListOutput) GoString() string {
1680	return s.String()
1681}
1682
1683// SetContentType sets the ContentType field's value.
1684func (s *GetMediaForFragmentListOutput) SetContentType(v string) *GetMediaForFragmentListOutput {
1685	s.ContentType = &v
1686	return s
1687}
1688
1689// SetPayload sets the Payload field's value.
1690func (s *GetMediaForFragmentListOutput) SetPayload(v io.ReadCloser) *GetMediaForFragmentListOutput {
1691	s.Payload = v
1692	return s
1693}
1694
1695// Contains the range of timestamps for the requested media, and the source
1696// of the timestamps.
1697type HLSFragmentSelector struct {
1698	_ struct{} `type:"structure"`
1699
1700	// The source of the timestamps for the requested media.
1701	//
1702	// When FragmentSelectorType is set to PRODUCER_TIMESTAMP and GetHLSStreamingSessionURLInput$PlaybackMode
1703	// is ON_DEMAND or LIVE_REPLAY, the first fragment ingested with a producer
1704	// timestamp within the specified FragmentSelector$TimestampRange is included
1705	// in the media playlist. In addition, the fragments with producer timestamps
1706	// within the TimestampRange ingested immediately following the first fragment
1707	// (up to the GetHLSStreamingSessionURLInput$MaxMediaPlaylistFragmentResults
1708	// value) are included.
1709	//
1710	// Fragments that have duplicate producer timestamps are deduplicated. This
1711	// means that if producers are producing a stream of fragments with producer
1712	// timestamps that are approximately equal to the true clock time, the HLS media
1713	// playlists will contain all of the fragments within the requested timestamp
1714	// range. If some fragments are ingested within the same time range and very
1715	// different points in time, only the oldest ingested collection of fragments
1716	// are returned.
1717	//
1718	// When FragmentSelectorType is set to PRODUCER_TIMESTAMP and GetHLSStreamingSessionURLInput$PlaybackMode
1719	// is LIVE, the producer timestamps are used in the MP4 fragments and for deduplication.
1720	// But the most recently ingested fragments based on server timestamps are included
1721	// in the HLS media playlist. This means that even if fragments ingested in
1722	// the past have producer timestamps with values now, they are not included
1723	// in the HLS media playlist.
1724	//
1725	// The default is SERVER_TIMESTAMP.
1726	FragmentSelectorType *string `type:"string" enum:"HLSFragmentSelectorType"`
1727
1728	// The start and end of the timestamp range for the requested media.
1729	//
1730	// This value should not be present if PlaybackType is LIVE.
1731	TimestampRange *HLSTimestampRange `type:"structure"`
1732}
1733
1734// String returns the string representation
1735func (s HLSFragmentSelector) String() string {
1736	return awsutil.Prettify(s)
1737}
1738
1739// GoString returns the string representation
1740func (s HLSFragmentSelector) GoString() string {
1741	return s.String()
1742}
1743
1744// SetFragmentSelectorType sets the FragmentSelectorType field's value.
1745func (s *HLSFragmentSelector) SetFragmentSelectorType(v string) *HLSFragmentSelector {
1746	s.FragmentSelectorType = &v
1747	return s
1748}
1749
1750// SetTimestampRange sets the TimestampRange field's value.
1751func (s *HLSFragmentSelector) SetTimestampRange(v *HLSTimestampRange) *HLSFragmentSelector {
1752	s.TimestampRange = v
1753	return s
1754}
1755
1756// The start and end of the timestamp range for the requested media.
1757//
1758// This value should not be present if PlaybackType is LIVE.
1759//
1760// The values in the HLSTimestampRange are inclusive. Fragments that begin before
1761// the start time but continue past it, or fragments that begin before the end
1762// time but continue past it, are included in the session.
1763type HLSTimestampRange struct {
1764	_ struct{} `type:"structure"`
1765
1766	// The end of the timestamp range for the requested media. This value must be
1767	// within 3 hours of the specified StartTimestamp, and it must be later than
1768	// the StartTimestamp value.
1769	//
1770	// If FragmentSelectorType for the request is SERVER_TIMESTAMP, this value must
1771	// be in the past.
1772	//
1773	// The EndTimestamp value is required for ON_DEMAND mode, but optional for LIVE_REPLAY
1774	// mode. If the EndTimestamp is not set for LIVE_REPLAY mode then the session
1775	// will continue to include newly ingested fragments until the session expires.
1776	//
1777	// This value is inclusive. The EndTimestamp is compared to the (starting) timestamp
1778	// of the fragment. Fragments that start before the EndTimestamp value and continue
1779	// past it are included in the session.
1780	EndTimestamp *time.Time `type:"timestamp"`
1781
1782	// The start of the timestamp range for the requested media.
1783	//
1784	// If the HLSTimestampRange value is specified, the StartTimestamp value is
1785	// required.
1786	//
1787	// This value is inclusive. Fragments that start before the StartTimestamp and
1788	// continue past it are included in the session. If FragmentSelectorType is
1789	// SERVER_TIMESTAMP, the StartTimestamp must be later than the stream head.
1790	StartTimestamp *time.Time `type:"timestamp"`
1791}
1792
1793// String returns the string representation
1794func (s HLSTimestampRange) String() string {
1795	return awsutil.Prettify(s)
1796}
1797
1798// GoString returns the string representation
1799func (s HLSTimestampRange) GoString() string {
1800	return s.String()
1801}
1802
1803// SetEndTimestamp sets the EndTimestamp field's value.
1804func (s *HLSTimestampRange) SetEndTimestamp(v time.Time) *HLSTimestampRange {
1805	s.EndTimestamp = &v
1806	return s
1807}
1808
1809// SetStartTimestamp sets the StartTimestamp field's value.
1810func (s *HLSTimestampRange) SetStartTimestamp(v time.Time) *HLSTimestampRange {
1811	s.StartTimestamp = &v
1812	return s
1813}
1814
1815type ListFragmentsInput struct {
1816	_ struct{} `type:"structure"`
1817
1818	// Describes the timestamp range and timestamp origin for the range of fragments
1819	// to return.
1820	FragmentSelector *FragmentSelector `type:"structure"`
1821
1822	// The total number of fragments to return. If the total number of fragments
1823	// available is more than the value specified in max-results, then a ListFragmentsOutput$NextToken
1824	// is provided in the output that you can use to resume pagination.
1825	MaxResults *int64 `min:"1" type:"long"`
1826
1827	// A token to specify where to start paginating. This is the ListFragmentsOutput$NextToken
1828	// from a previously truncated response.
1829	NextToken *string `min:"1" type:"string"`
1830
1831	// The name of the stream from which to retrieve a fragment list.
1832	//
1833	// StreamName is a required field
1834	StreamName *string `min:"1" type:"string" required:"true"`
1835}
1836
1837// String returns the string representation
1838func (s ListFragmentsInput) String() string {
1839	return awsutil.Prettify(s)
1840}
1841
1842// GoString returns the string representation
1843func (s ListFragmentsInput) GoString() string {
1844	return s.String()
1845}
1846
1847// Validate inspects the fields of the type to determine if they are valid.
1848func (s *ListFragmentsInput) Validate() error {
1849	invalidParams := request.ErrInvalidParams{Context: "ListFragmentsInput"}
1850	if s.MaxResults != nil && *s.MaxResults < 1 {
1851		invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
1852	}
1853	if s.NextToken != nil && len(*s.NextToken) < 1 {
1854		invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
1855	}
1856	if s.StreamName == nil {
1857		invalidParams.Add(request.NewErrParamRequired("StreamName"))
1858	}
1859	if s.StreamName != nil && len(*s.StreamName) < 1 {
1860		invalidParams.Add(request.NewErrParamMinLen("StreamName", 1))
1861	}
1862	if s.FragmentSelector != nil {
1863		if err := s.FragmentSelector.Validate(); err != nil {
1864			invalidParams.AddNested("FragmentSelector", err.(request.ErrInvalidParams))
1865		}
1866	}
1867
1868	if invalidParams.Len() > 0 {
1869		return invalidParams
1870	}
1871	return nil
1872}
1873
1874// SetFragmentSelector sets the FragmentSelector field's value.
1875func (s *ListFragmentsInput) SetFragmentSelector(v *FragmentSelector) *ListFragmentsInput {
1876	s.FragmentSelector = v
1877	return s
1878}
1879
1880// SetMaxResults sets the MaxResults field's value.
1881func (s *ListFragmentsInput) SetMaxResults(v int64) *ListFragmentsInput {
1882	s.MaxResults = &v
1883	return s
1884}
1885
1886// SetNextToken sets the NextToken field's value.
1887func (s *ListFragmentsInput) SetNextToken(v string) *ListFragmentsInput {
1888	s.NextToken = &v
1889	return s
1890}
1891
1892// SetStreamName sets the StreamName field's value.
1893func (s *ListFragmentsInput) SetStreamName(v string) *ListFragmentsInput {
1894	s.StreamName = &v
1895	return s
1896}
1897
1898type ListFragmentsOutput struct {
1899	_ struct{} `type:"structure"`
1900
1901	// A list of archived Fragment objects from the stream that meet the selector
1902	// criteria. Results are in no specific order, even across pages.
1903	Fragments []*Fragment `type:"list"`
1904
1905	// If the returned list is truncated, the operation returns this token to use
1906	// to retrieve the next page of results. This value is null when there are no
1907	// more results to return.
1908	NextToken *string `min:"1" type:"string"`
1909}
1910
1911// String returns the string representation
1912func (s ListFragmentsOutput) String() string {
1913	return awsutil.Prettify(s)
1914}
1915
1916// GoString returns the string representation
1917func (s ListFragmentsOutput) GoString() string {
1918	return s.String()
1919}
1920
1921// SetFragments sets the Fragments field's value.
1922func (s *ListFragmentsOutput) SetFragments(v []*Fragment) *ListFragmentsOutput {
1923	s.Fragments = v
1924	return s
1925}
1926
1927// SetNextToken sets the NextToken field's value.
1928func (s *ListFragmentsOutput) SetNextToken(v string) *ListFragmentsOutput {
1929	s.NextToken = &v
1930	return s
1931}
1932
1933// The range of timestamps for which to return fragments.
1934type TimestampRange struct {
1935	_ struct{} `type:"structure"`
1936
1937	// The ending timestamp in the range of timestamps for which to return fragments.
1938	//
1939	// EndTimestamp is a required field
1940	EndTimestamp *time.Time `type:"timestamp" required:"true"`
1941
1942	// The starting timestamp in the range of timestamps for which to return fragments.
1943	//
1944	// StartTimestamp is a required field
1945	StartTimestamp *time.Time `type:"timestamp" required:"true"`
1946}
1947
1948// String returns the string representation
1949func (s TimestampRange) String() string {
1950	return awsutil.Prettify(s)
1951}
1952
1953// GoString returns the string representation
1954func (s TimestampRange) GoString() string {
1955	return s.String()
1956}
1957
1958// Validate inspects the fields of the type to determine if they are valid.
1959func (s *TimestampRange) Validate() error {
1960	invalidParams := request.ErrInvalidParams{Context: "TimestampRange"}
1961	if s.EndTimestamp == nil {
1962		invalidParams.Add(request.NewErrParamRequired("EndTimestamp"))
1963	}
1964	if s.StartTimestamp == nil {
1965		invalidParams.Add(request.NewErrParamRequired("StartTimestamp"))
1966	}
1967
1968	if invalidParams.Len() > 0 {
1969		return invalidParams
1970	}
1971	return nil
1972}
1973
1974// SetEndTimestamp sets the EndTimestamp field's value.
1975func (s *TimestampRange) SetEndTimestamp(v time.Time) *TimestampRange {
1976	s.EndTimestamp = &v
1977	return s
1978}
1979
1980// SetStartTimestamp sets the StartTimestamp field's value.
1981func (s *TimestampRange) SetStartTimestamp(v time.Time) *TimestampRange {
1982	s.StartTimestamp = &v
1983	return s
1984}
1985
1986const (
1987	// ContainerFormatFragmentedMp4 is a ContainerFormat enum value
1988	ContainerFormatFragmentedMp4 = "FRAGMENTED_MP4"
1989
1990	// ContainerFormatMpegTs is a ContainerFormat enum value
1991	ContainerFormatMpegTs = "MPEG_TS"
1992)
1993
1994const (
1995	// DASHDisplayFragmentNumberAlways is a DASHDisplayFragmentNumber enum value
1996	DASHDisplayFragmentNumberAlways = "ALWAYS"
1997
1998	// DASHDisplayFragmentNumberNever is a DASHDisplayFragmentNumber enum value
1999	DASHDisplayFragmentNumberNever = "NEVER"
2000)
2001
2002const (
2003	// DASHDisplayFragmentTimestampAlways is a DASHDisplayFragmentTimestamp enum value
2004	DASHDisplayFragmentTimestampAlways = "ALWAYS"
2005
2006	// DASHDisplayFragmentTimestampNever is a DASHDisplayFragmentTimestamp enum value
2007	DASHDisplayFragmentTimestampNever = "NEVER"
2008)
2009
2010const (
2011	// DASHFragmentSelectorTypeProducerTimestamp is a DASHFragmentSelectorType enum value
2012	DASHFragmentSelectorTypeProducerTimestamp = "PRODUCER_TIMESTAMP"
2013
2014	// DASHFragmentSelectorTypeServerTimestamp is a DASHFragmentSelectorType enum value
2015	DASHFragmentSelectorTypeServerTimestamp = "SERVER_TIMESTAMP"
2016)
2017
2018const (
2019	// DASHPlaybackModeLive is a DASHPlaybackMode enum value
2020	DASHPlaybackModeLive = "LIVE"
2021
2022	// DASHPlaybackModeLiveReplay is a DASHPlaybackMode enum value
2023	DASHPlaybackModeLiveReplay = "LIVE_REPLAY"
2024
2025	// DASHPlaybackModeOnDemand is a DASHPlaybackMode enum value
2026	DASHPlaybackModeOnDemand = "ON_DEMAND"
2027)
2028
2029const (
2030	// FragmentSelectorTypeProducerTimestamp is a FragmentSelectorType enum value
2031	FragmentSelectorTypeProducerTimestamp = "PRODUCER_TIMESTAMP"
2032
2033	// FragmentSelectorTypeServerTimestamp is a FragmentSelectorType enum value
2034	FragmentSelectorTypeServerTimestamp = "SERVER_TIMESTAMP"
2035)
2036
2037const (
2038	// HLSDiscontinuityModeAlways is a HLSDiscontinuityMode enum value
2039	HLSDiscontinuityModeAlways = "ALWAYS"
2040
2041	// HLSDiscontinuityModeNever is a HLSDiscontinuityMode enum value
2042	HLSDiscontinuityModeNever = "NEVER"
2043
2044	// HLSDiscontinuityModeOnDiscontinuity is a HLSDiscontinuityMode enum value
2045	HLSDiscontinuityModeOnDiscontinuity = "ON_DISCONTINUITY"
2046)
2047
2048const (
2049	// HLSDisplayFragmentTimestampAlways is a HLSDisplayFragmentTimestamp enum value
2050	HLSDisplayFragmentTimestampAlways = "ALWAYS"
2051
2052	// HLSDisplayFragmentTimestampNever is a HLSDisplayFragmentTimestamp enum value
2053	HLSDisplayFragmentTimestampNever = "NEVER"
2054)
2055
2056const (
2057	// HLSFragmentSelectorTypeProducerTimestamp is a HLSFragmentSelectorType enum value
2058	HLSFragmentSelectorTypeProducerTimestamp = "PRODUCER_TIMESTAMP"
2059
2060	// HLSFragmentSelectorTypeServerTimestamp is a HLSFragmentSelectorType enum value
2061	HLSFragmentSelectorTypeServerTimestamp = "SERVER_TIMESTAMP"
2062)
2063
2064const (
2065	// HLSPlaybackModeLive is a HLSPlaybackMode enum value
2066	HLSPlaybackModeLive = "LIVE"
2067
2068	// HLSPlaybackModeLiveReplay is a HLSPlaybackMode enum value
2069	HLSPlaybackModeLiveReplay = "LIVE_REPLAY"
2070
2071	// HLSPlaybackModeOnDemand is a HLSPlaybackMode enum value
2072	HLSPlaybackModeOnDemand = "ON_DEMAND"
2073)
2074