-
Notifications
You must be signed in to change notification settings - Fork 602
/
api_op_GetMediaForFragmentList.go
231 lines (198 loc) · 8.19 KB
/
api_op_GetMediaForFragmentList.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
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package kinesisvideoarchivedmedia
import (
"context"
"io"
"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"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/GetMediaForFragmentListInput
type GetMediaForFragmentListInput struct {
_ struct{} `type:"structure"`
// A list of the numbers of fragments for which to retrieve media. You retrieve
// these values with ListFragments.
//
// Fragments is a required field
Fragments []string `min:"1" type:"list" required:"true"`
// The name of the stream from which to retrieve fragment media.
//
// StreamName is a required field
StreamName *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s GetMediaForFragmentListInput) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetMediaForFragmentListInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "GetMediaForFragmentListInput"}
if s.Fragments == nil {
invalidParams.Add(aws.NewErrParamRequired("Fragments"))
}
if s.Fragments != nil && len(s.Fragments) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("Fragments", 1))
}
if s.StreamName == nil {
invalidParams.Add(aws.NewErrParamRequired("StreamName"))
}
if s.StreamName != nil && len(*s.StreamName) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("StreamName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s GetMediaForFragmentListInput) MarshalFields(e protocol.FieldEncoder) error {
e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/json"), protocol.Metadata{})
if s.Fragments != nil {
v := s.Fragments
metadata := protocol.Metadata{}
ls0 := e.List(protocol.BodyTarget, "Fragments", metadata)
ls0.Start()
for _, v1 := range v {
ls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})
}
ls0.End()
}
if s.StreamName != nil {
v := *s.StreamName
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "StreamName", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/GetMediaForFragmentListOutput
type GetMediaForFragmentListOutput struct {
_ struct{} `type:"structure" payload:"Payload"`
// The content type of the requested media.
ContentType *string `location:"header" locationName:"Content-Type" min:"1" type:"string"`
// The payload that Kinesis Video Streams returns is a sequence of chunks from
// the specified stream. For information about the chunks, see PutMedia (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_dataplane_PutMedia.html).
// The chunks that Kinesis Video Streams returns in the GetMediaForFragmentList
// call also include the following additional Matroska (MKV) tags:
//
// * AWS_KINESISVIDEO_FRAGMENT_NUMBER - Fragment number returned in the chunk.
//
// * AWS_KINESISVIDEO_SERVER_SIDE_TIMESTAMP - Server-side timestamp of the
// fragment.
//
// * AWS_KINESISVIDEO_PRODUCER_SIDE_TIMESTAMP - Producer-side timestamp of
// the fragment.
//
// The following tags will be included if an exception occurs:
//
// * AWS_KINESISVIDEO_FRAGMENT_NUMBER - The number of the fragment that threw
// the exception
//
// * AWS_KINESISVIDEO_EXCEPTION_ERROR_CODE - The integer code of the exception
//
// * AWS_KINESISVIDEO_EXCEPTION_MESSAGE - A text description of the exception
Payload io.ReadCloser `type:"blob"`
}
// String returns the string representation
func (s GetMediaForFragmentListOutput) String() string {
return awsutil.Prettify(s)
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s GetMediaForFragmentListOutput) MarshalFields(e protocol.FieldEncoder) error {
if s.ContentType != nil {
v := *s.ContentType
metadata := protocol.Metadata{}
e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
// Skipping Payload Output type's body not valid.
return nil
}
const opGetMediaForFragmentList = "GetMediaForFragmentList"
// GetMediaForFragmentListRequest returns a request value for making API operation for
// Amazon Kinesis Video Streams Archived Media.
//
// Gets media for a list of fragments (specified by fragment number) from the
// archived data in an Amazon Kinesis video stream.
//
// You must first call the GetDataEndpoint API to get an endpoint. Then send
// the GetMediaForFragmentList requests to this endpoint using the --endpoint-url
// parameter (https://docs.aws.amazon.com/cli/latest/reference/).
//
// The following limits apply when using the GetMediaForFragmentList API:
//
// * A client can call GetMediaForFragmentList up to five times per second
// per stream.
//
// * Kinesis Video Streams sends media data at a rate of up to 25 megabytes
// per second (or 200 megabits per second) during a GetMediaForFragmentList
// session.
//
// If an error is thrown after invoking a Kinesis Video Streams archived media
// API, in addition to the HTTP status code and the response body, it includes
// the following pieces of information:
//
// * x-amz-ErrorType HTTP header – contains a more specific error type
// in addition to what the HTTP status code provides.
//
// * x-amz-RequestId HTTP header – if you want to report an issue to AWS,
// the support team can better diagnose the problem if given the Request
// Id.
//
// Both the HTTP status code and the ErrorType header can be utilized to make
// programmatic decisions about whether errors are retry-able and under what
// conditions, as well as provide information on what actions the client programmer
// might need to take in order to successfully try again.
//
// For more information, see the Errors section at the bottom of this topic,
// as well as Common Errors (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/CommonErrors.html).
//
// // Example sending a request using GetMediaForFragmentListRequest.
// req := client.GetMediaForFragmentListRequest(params)
// resp, err := req.Send(context.TODO())
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-archived-media-2017-09-30/GetMediaForFragmentList
func (c *Client) GetMediaForFragmentListRequest(input *GetMediaForFragmentListInput) GetMediaForFragmentListRequest {
op := &aws.Operation{
Name: opGetMediaForFragmentList,
HTTPMethod: "POST",
HTTPPath: "/getMediaForFragmentList",
}
if input == nil {
input = &GetMediaForFragmentListInput{}
}
req := c.newRequest(op, input, &GetMediaForFragmentListOutput{})
return GetMediaForFragmentListRequest{Request: req, Input: input, Copy: c.GetMediaForFragmentListRequest}
}
// GetMediaForFragmentListRequest is the request type for the
// GetMediaForFragmentList API operation.
type GetMediaForFragmentListRequest struct {
*aws.Request
Input *GetMediaForFragmentListInput
Copy func(*GetMediaForFragmentListInput) GetMediaForFragmentListRequest
}
// Send marshals and sends the GetMediaForFragmentList API request.
func (r GetMediaForFragmentListRequest) Send(ctx context.Context) (*GetMediaForFragmentListResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &GetMediaForFragmentListResponse{
GetMediaForFragmentListOutput: r.Request.Data.(*GetMediaForFragmentListOutput),
response: &aws.Response{Request: r.Request},
}
return resp, nil
}
// GetMediaForFragmentListResponse is the response type for the
// GetMediaForFragmentList API operation.
type GetMediaForFragmentListResponse struct {
*GetMediaForFragmentListOutput
response *aws.Response
}
// SDKResponseMetdata returns the response metadata for the
// GetMediaForFragmentList request.
func (r *GetMediaForFragmentListResponse) SDKResponseMetdata() *aws.Response {
return r.response
}