-
Notifications
You must be signed in to change notification settings - Fork 616
/
api_types.go
460 lines (394 loc) · 17.1 KB
/
api_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package kinesisvideoarchivedmedia
import (
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
var _ aws.Config
var _ = awsutil.Prettify
// Contains the range of timestamps for the requested media, and the source
// of the timestamps.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/DASHFragmentSelector
type DASHFragmentSelector struct {
_ struct{} `type:"structure"`
// The source of the timestamps for the requested media.
//
// When FragmentSelectorType is set to PRODUCER_TIMESTAMP and GetDASHStreamingSessionURLInput$PlaybackMode
// is ON_DEMAND or LIVE_REPLAY, the first fragment ingested with a producer
// timestamp within the specified FragmentSelector$TimestampRange is included
// in the media playlist. In addition, the fragments with producer timestamps
// within the TimestampRange ingested immediately following the first fragment
// (up to the GetDASHStreamingSessionURLInput$MaxManifestFragmentResults value)
// are included.
//
// Fragments that have duplicate producer timestamps are deduplicated. This
// means that if producers are producing a stream of fragments with producer
// timestamps that are approximately equal to the true clock time, the MPEG-DASH
// manifest will contain all of the fragments within the requested timestamp
// range. If some fragments are ingested within the same time range and very
// different points in time, only the oldest ingested collection of fragments
// are returned.
//
// When FragmentSelectorType is set to PRODUCER_TIMESTAMP and GetDASHStreamingSessionURLInput$PlaybackMode
// is LIVE, the producer timestamps are used in the MP4 fragments and for deduplication.
// But the most recently ingested fragments based on server timestamps are included
// in the MPEG-DASH manifest. This means that even if fragments ingested in
// the past have producer timestamps with values now, they are not included
// in the HLS media playlist.
//
// The default is SERVER_TIMESTAMP.
FragmentSelectorType DASHFragmentSelectorType `type:"string" enum:"true"`
// The start and end of the timestamp range for the requested media.
//
// This value should not be present if PlaybackType is LIVE.
TimestampRange *DASHTimestampRange `type:"structure"`
}
// String returns the string representation
func (s DASHFragmentSelector) String() string {
return awsutil.Prettify(s)
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s DASHFragmentSelector) MarshalFields(e protocol.FieldEncoder) error {
if len(s.FragmentSelectorType) > 0 {
v := s.FragmentSelectorType
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "FragmentSelectorType", protocol.QuotedValue{ValueMarshaler: v}, metadata)
}
if s.TimestampRange != nil {
v := s.TimestampRange
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "TimestampRange", v, metadata)
}
return nil
}
// The start and end of the timestamp range for the requested media.
//
// This value should not be present if PlaybackType is LIVE.
//
// The values in the DASHimestampRange are inclusive. Fragments that begin before
// the start time but continue past it, or fragments that begin before the end
// time but continue past it, are included in the session.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/DASHTimestampRange
type DASHTimestampRange struct {
_ struct{} `type:"structure"`
// The end of the timestamp range for the requested media. This value must be
// within 3 hours of the specified StartTimestamp, and it must be later than
// the StartTimestamp value.
//
// If FragmentSelectorType for the request is SERVER_TIMESTAMP, this value must
// be in the past.
//
// The EndTimestamp value is required for ON_DEMAND mode, but optional for LIVE_REPLAY
// mode. If the EndTimestamp is not set for LIVE_REPLAY mode then the session
// will continue to include newly ingested fragments until the session expires.
//
// This value is inclusive. The EndTimestamp is compared to the (starting) timestamp
// of the fragment. Fragments that start before the EndTimestamp value and continue
// past it are included in the session.
EndTimestamp *time.Time `type:"timestamp"`
// The start of the timestamp range for the requested media.
//
// If the DASHTimestampRange value is specified, the StartTimestamp value is
// required.
//
// This value is inclusive. Fragments that start before the StartTimestamp and
// continue past it are included in the session. If FragmentSelectorType is
// SERVER_TIMESTAMP, the StartTimestamp must be later than the stream head.
StartTimestamp *time.Time `type:"timestamp"`
}
// String returns the string representation
func (s DASHTimestampRange) String() string {
return awsutil.Prettify(s)
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s DASHTimestampRange) MarshalFields(e protocol.FieldEncoder) error {
if s.EndTimestamp != nil {
v := *s.EndTimestamp
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "EndTimestamp",
protocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)
}
if s.StartTimestamp != nil {
v := *s.StartTimestamp
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "StartTimestamp",
protocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)
}
return nil
}
// Represents a segment of video or other time-delimited data.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/Fragment
type Fragment struct {
_ struct{} `type:"structure"`
// The playback duration or other time value associated with the fragment.
FragmentLengthInMilliseconds *int64 `type:"long"`
// The unique identifier of the fragment. This value monotonically increases
// based on the ingestion order.
FragmentNumber *string `min:"1" type:"string"`
// The total fragment size, including information about the fragment and contained
// media data.
FragmentSizeInBytes *int64 `type:"long"`
// The timestamp from the producer corresponding to the fragment.
ProducerTimestamp *time.Time `type:"timestamp"`
// The timestamp from the AWS server corresponding to the fragment.
ServerTimestamp *time.Time `type:"timestamp"`
}
// String returns the string representation
func (s Fragment) String() string {
return awsutil.Prettify(s)
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s Fragment) MarshalFields(e protocol.FieldEncoder) error {
if s.FragmentLengthInMilliseconds != nil {
v := *s.FragmentLengthInMilliseconds
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "FragmentLengthInMilliseconds", protocol.Int64Value(v), metadata)
}
if s.FragmentNumber != nil {
v := *s.FragmentNumber
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "FragmentNumber", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.FragmentSizeInBytes != nil {
v := *s.FragmentSizeInBytes
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "FragmentSizeInBytes", protocol.Int64Value(v), metadata)
}
if s.ProducerTimestamp != nil {
v := *s.ProducerTimestamp
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "ProducerTimestamp",
protocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)
}
if s.ServerTimestamp != nil {
v := *s.ServerTimestamp
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "ServerTimestamp",
protocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)
}
return nil
}
// Describes the timestamp range and timestamp origin of a range of fragments.
//
// Only fragments with a start timestamp greater than or equal to the given
// start time and less than or equal to the end time are returned. For example,
// if a stream contains fragments with the following start timestamps:
//
// * 00:00:00
//
// * 00:00:02
//
// * 00:00:04
//
// * 00:00:06
//
// A fragment selector range with a start time of 00:00:01 and end time of 00:00:04
// would return the fragments with start times of 00:00:02 and 00:00:04.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/FragmentSelector
type FragmentSelector struct {
_ struct{} `type:"structure"`
// The origin of the timestamps to use (Server or Producer).
//
// FragmentSelectorType is a required field
FragmentSelectorType FragmentSelectorType `type:"string" required:"true" enum:"true"`
// The range of timestamps to return.
//
// TimestampRange is a required field
TimestampRange *TimestampRange `type:"structure" required:"true"`
}
// String returns the string representation
func (s FragmentSelector) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *FragmentSelector) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "FragmentSelector"}
if len(s.FragmentSelectorType) == 0 {
invalidParams.Add(aws.NewErrParamRequired("FragmentSelectorType"))
}
if s.TimestampRange == nil {
invalidParams.Add(aws.NewErrParamRequired("TimestampRange"))
}
if s.TimestampRange != nil {
if err := s.TimestampRange.Validate(); err != nil {
invalidParams.AddNested("TimestampRange", err.(aws.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s FragmentSelector) MarshalFields(e protocol.FieldEncoder) error {
if len(s.FragmentSelectorType) > 0 {
v := s.FragmentSelectorType
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "FragmentSelectorType", protocol.QuotedValue{ValueMarshaler: v}, metadata)
}
if s.TimestampRange != nil {
v := s.TimestampRange
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "TimestampRange", v, metadata)
}
return nil
}
// Contains the range of timestamps for the requested media, and the source
// of the timestamps.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/HLSFragmentSelector
type HLSFragmentSelector struct {
_ struct{} `type:"structure"`
// The source of the timestamps for the requested media.
//
// When FragmentSelectorType is set to PRODUCER_TIMESTAMP and GetHLSStreamingSessionURLInput$PlaybackMode
// is ON_DEMAND or LIVE_REPLAY, the first fragment ingested with a producer
// timestamp within the specified FragmentSelector$TimestampRange is included
// in the media playlist. In addition, the fragments with producer timestamps
// within the TimestampRange ingested immediately following the first fragment
// (up to the GetHLSStreamingSessionURLInput$MaxMediaPlaylistFragmentResults
// value) are included.
//
// Fragments that have duplicate producer timestamps are deduplicated. This
// means that if producers are producing a stream of fragments with producer
// timestamps that are approximately equal to the true clock time, the HLS media
// playlists will contain all of the fragments within the requested timestamp
// range. If some fragments are ingested within the same time range and very
// different points in time, only the oldest ingested collection of fragments
// are returned.
//
// When FragmentSelectorType is set to PRODUCER_TIMESTAMP and GetHLSStreamingSessionURLInput$PlaybackMode
// is LIVE, the producer timestamps are used in the MP4 fragments and for deduplication.
// But the most recently ingested fragments based on server timestamps are included
// in the HLS media playlist. This means that even if fragments ingested in
// the past have producer timestamps with values now, they are not included
// in the HLS media playlist.
//
// The default is SERVER_TIMESTAMP.
FragmentSelectorType HLSFragmentSelectorType `type:"string" enum:"true"`
// The start and end of the timestamp range for the requested media.
//
// This value should not be present if PlaybackType is LIVE.
TimestampRange *HLSTimestampRange `type:"structure"`
}
// String returns the string representation
func (s HLSFragmentSelector) String() string {
return awsutil.Prettify(s)
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s HLSFragmentSelector) MarshalFields(e protocol.FieldEncoder) error {
if len(s.FragmentSelectorType) > 0 {
v := s.FragmentSelectorType
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "FragmentSelectorType", protocol.QuotedValue{ValueMarshaler: v}, metadata)
}
if s.TimestampRange != nil {
v := s.TimestampRange
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "TimestampRange", v, metadata)
}
return nil
}
// The start and end of the timestamp range for the requested media.
//
// This value should not be present if PlaybackType is LIVE.
//
// The values in the HLSTimestampRange are inclusive. Fragments that begin before
// the start time but continue past it, or fragments that begin before the end
// time but continue past it, are included in the session.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/HLSTimestampRange
type HLSTimestampRange struct {
_ struct{} `type:"structure"`
// The end of the timestamp range for the requested media. This value must be
// within 3 hours of the specified StartTimestamp, and it must be later than
// the StartTimestamp value.
//
// If FragmentSelectorType for the request is SERVER_TIMESTAMP, this value must
// be in the past.
//
// The EndTimestamp value is required for ON_DEMAND mode, but optional for LIVE_REPLAY
// mode. If the EndTimestamp is not set for LIVE_REPLAY mode then the session
// will continue to include newly ingested fragments until the session expires.
//
// This value is inclusive. The EndTimestamp is compared to the (starting) timestamp
// of the fragment. Fragments that start before the EndTimestamp value and continue
// past it are included in the session.
EndTimestamp *time.Time `type:"timestamp"`
// The start of the timestamp range for the requested media.
//
// If the HLSTimestampRange value is specified, the StartTimestamp value is
// required.
//
// This value is inclusive. Fragments that start before the StartTimestamp and
// continue past it are included in the session. If FragmentSelectorType is
// SERVER_TIMESTAMP, the StartTimestamp must be later than the stream head.
StartTimestamp *time.Time `type:"timestamp"`
}
// String returns the string representation
func (s HLSTimestampRange) String() string {
return awsutil.Prettify(s)
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s HLSTimestampRange) MarshalFields(e protocol.FieldEncoder) error {
if s.EndTimestamp != nil {
v := *s.EndTimestamp
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "EndTimestamp",
protocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)
}
if s.StartTimestamp != nil {
v := *s.StartTimestamp
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "StartTimestamp",
protocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)
}
return nil
}
// The range of timestamps for which to return fragments.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/TimestampRange
type TimestampRange struct {
_ struct{} `type:"structure"`
// The ending timestamp in the range of timestamps for which to return fragments.
//
// EndTimestamp is a required field
EndTimestamp *time.Time `type:"timestamp" required:"true"`
// The starting timestamp in the range of timestamps for which to return fragments.
//
// StartTimestamp is a required field
StartTimestamp *time.Time `type:"timestamp" required:"true"`
}
// String returns the string representation
func (s TimestampRange) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *TimestampRange) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "TimestampRange"}
if s.EndTimestamp == nil {
invalidParams.Add(aws.NewErrParamRequired("EndTimestamp"))
}
if s.StartTimestamp == nil {
invalidParams.Add(aws.NewErrParamRequired("StartTimestamp"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s TimestampRange) MarshalFields(e protocol.FieldEncoder) error {
if s.EndTimestamp != nil {
v := *s.EndTimestamp
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "EndTimestamp",
protocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)
}
if s.StartTimestamp != nil {
v := *s.StartTimestamp
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "StartTimestamp",
protocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)
}
return nil
}