Debian Codegraph @

service/kinesisvideowebrtcstorage/api.go

raw
1 // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
2
3 package kinesisvideowebrtcstorage
4
5 import (
6 "fmt"
7
8 "github.com/aws/aws-sdk-go/aws"
9 "github.com/aws/aws-sdk-go/aws/awsutil"
10 "github.com/aws/aws-sdk-go/aws/request"
11 "github.com/aws/aws-sdk-go/private/protocol"
12 "github.com/aws/aws-sdk-go/private/protocol/restjson"
13 )
14
15 const opJoinStorageSession = "JoinStorageSession"
16
17 // JoinStorageSessionRequest generates a "aws/request.Request" representing the
18 // client's request for the JoinStorageSession operation. The "output" return
19 // value will be populated with the request's response once the request completes
20 // successfully.
21 //
22 // Use "Send" method on the returned Request to send the API call to the service.
23 // the "output" return value is not valid until after Send returns without error.
24 //
25 // See JoinStorageSession for more information on using the JoinStorageSession
26 // API call, and error handling.
27 //
28 // This method is useful when you want to inject custom logic or configuration
29 // into the SDK's request lifecycle. Such as custom headers, or retry logic.
30 //
31 // // Example sending a request using the JoinStorageSessionRequest method.
32 // req, resp := client.JoinStorageSessionRequest(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-webrtc-storage-2018-05-10/JoinStorageSession
40 func (c *KinesisVideoWebRTCStorage) JoinStorageSessionRequest(input *JoinStorageSessionInput) (req *request.Request, output *JoinStorageSessionOutput) {
41 op := &request.Operation{
42 Name: opJoinStorageSession,
43 HTTPMethod: "POST",
44 HTTPPath: "/joinStorageSession",
45 }
46
47 if input == nil {
48 input = &JoinStorageSessionInput{}
49 }
50
51 output = &JoinStorageSessionOutput{}
52 req = c.newRequest(op, input, output)
53 req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
54 return
55 }
56
57 // JoinStorageSession API operation for Amazon Kinesis Video WebRTC Storage.
58 //
59 // Join the ongoing one way-video and/or multi-way audio WebRTC session as a
60 // video producing device for an input channel. If there’s no existing session
61 // for the channel, a new streaming session needs to be created, and the Amazon
62 // Resource Name (ARN) of the signaling channel must be provided.
63 //
64 // Currently for the SINGLE_MASTER type, a video producing device is able to
65 // ingest both audio and video media into a stream, while viewers can only ingest
66 // audio. Both a video producing device and viewers can join the session first,
67 // and wait for other participants.
68 //
69 // While participants are having peer to peer conversations through webRTC,
70 // the ingested media session will be stored into the Kinesis Video Stream.
71 // Multiple viewers are able to playback real-time media.
72 //
73 // Customers can also use existing Kinesis Video Streams features like HLS or
74 // DASH playback, Image generation, and more with ingested WebRTC media.
75 //
76 // Assume that only one video producing device client can be associated with
77 // a session for the channel. If more than one client joins the session of a
78 // specific channel as a video producing device, the most recent client request
79 // takes precedence.
80 //
81 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
82 // with awserr.Error's Code and Message methods to get detailed information about
83 // the error.
84 //
85 // See the AWS API reference guide for Amazon Kinesis Video WebRTC Storage's
86 // API operation JoinStorageSession for usage and error information.
87 //
88 // Returned Error Types:
89 //
90 // - ClientLimitExceededException
91 // Kinesis Video Streams has throttled the request because you have exceeded
92 // the limit of allowed client calls. Try making the call later.
93 //
94 // - InvalidArgumentException
95 // The value for this input parameter is invalid.
96 //
97 // - AccessDeniedException
98 // You do not have required permissions to perform this operation.
99 //
100 // - ResourceNotFoundException
101 // The specified resource is not found.
102 //
103 // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-webrtc-storage-2018-05-10/JoinStorageSession
104 func (c *KinesisVideoWebRTCStorage) JoinStorageSession(input *JoinStorageSessionInput) (*JoinStorageSessionOutput, error) {
105 req, out := c.JoinStorageSessionRequest(input)
106 return out, req.Send()
107 }
108
109 // JoinStorageSessionWithContext is the same as JoinStorageSession with the addition of
110 // the ability to pass a context and additional request options.
111 //
112 // See JoinStorageSession for details on how to use this API operation.
113 //
114 // The context must be non-nil and will be used for request cancellation. If
115 // the context is nil a panic will occur. In the future the SDK may create
116 // sub-contexts for http.Requests. See https://golang.org/pkg/context/
117 // for more information on using Contexts.
118 func (c *KinesisVideoWebRTCStorage) JoinStorageSessionWithContext(ctx aws.Context, input *JoinStorageSessionInput, opts ...request.Option) (*JoinStorageSessionOutput, error) {
119 req, out := c.JoinStorageSessionRequest(input)
120 req.SetContext(ctx)
121 req.ApplyOptions(opts...)
122 return out, req.Send()
123 }
124
125 // You do not have required permissions to perform this operation.
126 type AccessDeniedException struct {
127 _ struct{} `type:"structure"`
128 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
129
130 Message_ *string `locationName:"message" type:"string"`
131 }
132
133 // String returns the string representation.
134 //
135 // API parameter values that are decorated as "sensitive" in the API will not
136 // be included in the string output. The member name will be present, but the
137 // value will be replaced with "sensitive".
138 func (s AccessDeniedException) String() string {
139 return awsutil.Prettify(s)
140 }
141
142 // GoString returns the string representation.
143 //
144 // API parameter values that are decorated as "sensitive" in the API will not
145 // be included in the string output. The member name will be present, but the
146 // value will be replaced with "sensitive".
147 func (s AccessDeniedException) GoString() string {
148 return s.String()
149 }
150
151 func newErrorAccessDeniedException(v protocol.ResponseMetadata) error {
152 return &AccessDeniedException{
153 RespMetadata: v,
154 }
155 }
156
157 // Code returns the exception type name.
158 func (s *AccessDeniedException) Code() string {
159 return "AccessDeniedException"
160 }
161
162 // Message returns the exception's message.
163 func (s *AccessDeniedException) Message() string {
164 if s.Message_ != nil {
165 return *s.Message_
166 }
167 return ""
168 }
169
170 // OrigErr always returns nil, satisfies awserr.Error interface.
171 func (s *AccessDeniedException) OrigErr() error {
172 return nil
173 }
174
175 func (s *AccessDeniedException) Error() string {
176 return fmt.Sprintf("%s: %s", s.Code(), s.Message())
177 }
178
179 // Status code returns the HTTP status code for the request's response error.
180 func (s *AccessDeniedException) StatusCode() int {
181 return s.RespMetadata.StatusCode
182 }
183
184 // RequestID returns the service's response RequestID for request.
185 func (s *AccessDeniedException) RequestID() string {
186 return s.RespMetadata.RequestID
187 }
188
189 // Kinesis Video Streams has throttled the request because you have exceeded
190 // the limit of allowed client calls. Try making the call later.
191 type ClientLimitExceededException struct {
192 _ struct{} `type:"structure"`
193 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
194
195 Message_ *string `locationName:"message" type:"string"`
196 }
197
198 // String returns the string representation.
199 //
200 // API parameter values that are decorated as "sensitive" in the API will not
201 // be included in the string output. The member name will be present, but the
202 // value will be replaced with "sensitive".
203 func (s ClientLimitExceededException) String() string {
204 return awsutil.Prettify(s)
205 }
206
207 // GoString returns the string representation.
208 //
209 // API parameter values that are decorated as "sensitive" in the API will not
210 // be included in the string output. The member name will be present, but the
211 // value will be replaced with "sensitive".
212 func (s ClientLimitExceededException) GoString() string {
213 return s.String()
214 }
215
216 func newErrorClientLimitExceededException(v protocol.ResponseMetadata) error {
217 return &ClientLimitExceededException{
218 RespMetadata: v,
219 }
220 }
221
222 // Code returns the exception type name.
223 func (s *ClientLimitExceededException) Code() string {
224 return "ClientLimitExceededException"
225 }
226
227 // Message returns the exception's message.
228 func (s *ClientLimitExceededException) Message() string {
229 if s.Message_ != nil {
230 return *s.Message_
231 }
232 return ""
233 }
234
235 // OrigErr always returns nil, satisfies awserr.Error interface.
236 func (s *ClientLimitExceededException) OrigErr() error {
237 return nil
238 }
239
240 func (s *ClientLimitExceededException) Error() string {
241 return fmt.Sprintf("%s: %s", s.Code(), s.Message())
242 }
243
244 // Status code returns the HTTP status code for the request's response error.
245 func (s *ClientLimitExceededException) StatusCode() int {
246 return s.RespMetadata.StatusCode
247 }
248
249 // RequestID returns the service's response RequestID for request.
250 func (s *ClientLimitExceededException) RequestID() string {
251 return s.RespMetadata.RequestID
252 }
253
254 // The value for this input parameter is invalid.
255 type InvalidArgumentException struct {
256 _ struct{} `type:"structure"`
257 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
258
259 Message_ *string `locationName:"message" type:"string"`
260 }
261
262 // String returns the string representation.
263 //
264 // API parameter values that are decorated as "sensitive" in the API will not
265 // be included in the string output. The member name will be present, but the
266 // value will be replaced with "sensitive".
267 func (s InvalidArgumentException) String() string {
268 return awsutil.Prettify(s)
269 }
270
271 // GoString returns the string representation.
272 //
273 // API parameter values that are decorated as "sensitive" in the API will not
274 // be included in the string output. The member name will be present, but the
275 // value will be replaced with "sensitive".
276 func (s InvalidArgumentException) GoString() string {
277 return s.String()
278 }
279
280 func newErrorInvalidArgumentException(v protocol.ResponseMetadata) error {
281 return &InvalidArgumentException{
282 RespMetadata: v,
283 }
284 }
285
286 // Code returns the exception type name.
287 func (s *InvalidArgumentException) Code() string {
288 return "InvalidArgumentException"
289 }
290
291 // Message returns the exception's message.
292 func (s *InvalidArgumentException) Message() string {
293 if s.Message_ != nil {
294 return *s.Message_
295 }
296 return ""
297 }
298
299 // OrigErr always returns nil, satisfies awserr.Error interface.
300 func (s *InvalidArgumentException) OrigErr() error {
301 return nil
302 }
303
304 func (s *InvalidArgumentException) Error() string {
305 return fmt.Sprintf("%s: %s", s.Code(), s.Message())
306 }
307
308 // Status code returns the HTTP status code for the request's response error.
309 func (s *InvalidArgumentException) StatusCode() int {
310 return s.RespMetadata.StatusCode
311 }
312
313 // RequestID returns the service's response RequestID for request.
314 func (s *InvalidArgumentException) RequestID() string {
315 return s.RespMetadata.RequestID
316 }
317
318 type JoinStorageSessionInput struct {
319 _ struct{} `type:"structure"`
320
321 // The Amazon Resource Name (ARN) of the signaling channel.
322 //
323 // ChannelArn is a required field
324 ChannelArn *string `locationName:"channelArn" type:"string" required:"true"`
325 }
326
327 // String returns the string representation.
328 //
329 // API parameter values that are decorated as "sensitive" in the API will not
330 // be included in the string output. The member name will be present, but the
331 // value will be replaced with "sensitive".
332 func (s JoinStorageSessionInput) String() string {
333 return awsutil.Prettify(s)
334 }
335
336 // GoString returns the string representation.
337 //
338 // API parameter values that are decorated as "sensitive" in the API will not
339 // be included in the string output. The member name will be present, but the
340 // value will be replaced with "sensitive".
341 func (s JoinStorageSessionInput) GoString() string {
342 return s.String()
343 }
344
345 // Validate inspects the fields of the type to determine if they are valid.
346 func (s *JoinStorageSessionInput) Validate() error {
347 invalidParams := request.ErrInvalidParams{Context: "JoinStorageSessionInput"}
348 if s.ChannelArn == nil {
349 invalidParams.Add(request.NewErrParamRequired("ChannelArn"))
350 }
351
352 if invalidParams.Len() > 0 {
353 return invalidParams
354 }
355 return nil
356 }
357
358 // SetChannelArn sets the ChannelArn field's value.
359 func (s *JoinStorageSessionInput) SetChannelArn(v string) *JoinStorageSessionInput {
360 s.ChannelArn = &v
361 return s
362 }
363
364 type JoinStorageSessionOutput struct {
365 _ struct{} `type:"structure"`
366 }
367
368 // String returns the string representation.
369 //
370 // API parameter values that are decorated as "sensitive" in the API will not
371 // be included in the string output. The member name will be present, but the
372 // value will be replaced with "sensitive".
373 func (s JoinStorageSessionOutput) String() string {
374 return awsutil.Prettify(s)
375 }
376
377 // GoString returns the string representation.
378 //
379 // API parameter values that are decorated as "sensitive" in the API will not
380 // be included in the string output. The member name will be present, but the
381 // value will be replaced with "sensitive".
382 func (s JoinStorageSessionOutput) GoString() string {
383 return s.String()
384 }
385
386 // The specified resource is not found.
387 type ResourceNotFoundException struct {
388 _ struct{} `type:"structure"`
389 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
390
391 Message_ *string `locationName:"message" type:"string"`
392 }
393
394 // String returns the string representation.
395 //
396 // API parameter values that are decorated as "sensitive" in the API will not
397 // be included in the string output. The member name will be present, but the
398 // value will be replaced with "sensitive".
399 func (s ResourceNotFoundException) String() string {
400 return awsutil.Prettify(s)
401 }
402
403 // GoString returns the string representation.
404 //
405 // API parameter values that are decorated as "sensitive" in the API will not
406 // be included in the string output. The member name will be present, but the
407 // value will be replaced with "sensitive".
408 func (s ResourceNotFoundException) GoString() string {
409 return s.String()
410 }
411
412 func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error {
413 return &ResourceNotFoundException{
414 RespMetadata: v,
415 }
416 }
417
418 // Code returns the exception type name.
419 func (s *ResourceNotFoundException) Code() string {
420 return "ResourceNotFoundException"
421 }
422
423 // Message returns the exception's message.
424 func (s *ResourceNotFoundException) Message() string {
425 if s.Message_ != nil {
426 return *s.Message_
427 }
428 return ""
429 }
430
431 // OrigErr always returns nil, satisfies awserr.Error interface.
432 func (s *ResourceNotFoundException) OrigErr() error {
433 return nil
434 }
435
436 func (s *ResourceNotFoundException) Error() string {
437 return fmt.Sprintf("%s: %s", s.Code(), s.Message())
438 }
439
440 // Status code returns the HTTP status code for the request's response error.
441 func (s *ResourceNotFoundException) StatusCode() int {
442 return s.RespMetadata.StatusCode
443 }
444
445 // RequestID returns the service's response RequestID for request.
446 func (s *ResourceNotFoundException) RequestID() string {
447 return s.RespMetadata.RequestID
448 }