github.com/aavshr/aws-sdk-go@v1.41.3/service/kinesisvideomedia/api.go (about) 1 // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3 package kinesisvideomedia 4 5 import ( 6 "fmt" 7 "io" 8 "time" 9 10 "github.com/aavshr/aws-sdk-go/aws" 11 "github.com/aavshr/aws-sdk-go/aws/awsutil" 12 "github.com/aavshr/aws-sdk-go/aws/request" 13 "github.com/aavshr/aws-sdk-go/private/protocol" 14 ) 15 16 const opGetMedia = "GetMedia" 17 18 // GetMediaRequest generates a "aws/request.Request" representing the 19 // client's request for the GetMedia operation. The "output" return 20 // value will be populated with the request's response once the request completes 21 // successfully. 22 // 23 // Use "Send" method on the returned Request to send the API call to the service. 24 // the "output" return value is not valid until after Send returns without error. 25 // 26 // See GetMedia for more information on using the GetMedia 27 // API call, and error handling. 28 // 29 // This method is useful when you want to inject custom logic or configuration 30 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 31 // 32 // 33 // // Example sending a request using the GetMediaRequest method. 34 // req, resp := client.GetMediaRequest(params) 35 // 36 // err := req.Send() 37 // if err == nil { // resp is now filled 38 // fmt.Println(resp) 39 // } 40 // 41 // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-media-2017-09-30/GetMedia 42 func (c *KinesisVideoMedia) GetMediaRequest(input *GetMediaInput) (req *request.Request, output *GetMediaOutput) { 43 op := &request.Operation{ 44 Name: opGetMedia, 45 HTTPMethod: "POST", 46 HTTPPath: "/getMedia", 47 } 48 49 if input == nil { 50 input = &GetMediaInput{} 51 } 52 53 output = &GetMediaOutput{} 54 req = c.newRequest(op, input, output) 55 return 56 } 57 58 // GetMedia API operation for Amazon Kinesis Video Streams Media. 59 // 60 // Use this API to retrieve media content from a Kinesis video stream. In the 61 // request, you identify the stream name or stream Amazon Resource Name (ARN), 62 // and the starting chunk. Kinesis Video Streams then returns a stream of chunks 63 // in order by fragment number. 64 // 65 // You must first call the GetDataEndpoint API to get an endpoint. Then send 66 // the GetMedia requests to this endpoint using the --endpoint-url parameter 67 // (https://docs.aws.amazon.com/cli/latest/reference/). 68 // 69 // When you put media data (fragments) on a stream, Kinesis Video Streams stores 70 // each incoming fragment and related metadata in what is called a "chunk." 71 // For more information, see PutMedia (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_dataplane_PutMedia.html). 72 // The GetMedia API returns a stream of these chunks starting from the chunk 73 // that you specify in the request. 74 // 75 // The following limits apply when using the GetMedia API: 76 // 77 // * A client can call GetMedia up to five times per second per stream. 78 // 79 // * Kinesis Video Streams sends media data at a rate of up to 25 megabytes 80 // per second (or 200 megabits per second) during a GetMedia session. 81 // 82 // If an error is thrown after invoking a Kinesis Video Streams media API, in 83 // addition to the HTTP status code and the response body, it includes the following 84 // pieces of information: 85 // 86 // * x-amz-ErrorType HTTP header – contains a more specific error type 87 // in addition to what the HTTP status code provides. 88 // 89 // * x-amz-RequestId HTTP header – if you want to report an issue to AWS, 90 // the support team can better diagnose the problem if given the Request 91 // Id. 92 // 93 // Both the HTTP status code and the ErrorType header can be utilized to make 94 // programmatic decisions about whether errors are retry-able and under what 95 // conditions, as well as provide information on what actions the client programmer 96 // might need to take in order to successfully try again. 97 // 98 // For more information, see the Errors section at the bottom of this topic, 99 // as well as Common Errors (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/CommonErrors.html). 100 // 101 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 102 // with awserr.Error's Code and Message methods to get detailed information about 103 // the error. 104 // 105 // See the AWS API reference guide for Amazon Kinesis Video Streams Media's 106 // API operation GetMedia for usage and error information. 107 // 108 // Returned Error Types: 109 // * ResourceNotFoundException 110 // Status Code: 404, The stream with the given name does not exist. 111 // 112 // * NotAuthorizedException 113 // Status Code: 403, The caller is not authorized to perform an operation on 114 // the given stream, or the token has expired. 115 // 116 // * InvalidEndpointException 117 // Status Code: 400, Caller used wrong endpoint to write data to a stream. On 118 // receiving such an exception, the user must call GetDataEndpoint with AccessMode 119 // set to "READ" and use the endpoint Kinesis Video returns in the next GetMedia 120 // call. 121 // 122 // * ClientLimitExceededException 123 // Kinesis Video Streams has throttled the request because you have exceeded 124 // the limit of allowed client calls. Try making the call later. 125 // 126 // * ConnectionLimitExceededException 127 // Kinesis Video Streams has throttled the request because you have exceeded 128 // the limit of allowed client connections. 129 // 130 // * InvalidArgumentException 131 // The value for this input parameter is invalid. 132 // 133 // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-media-2017-09-30/GetMedia 134 func (c *KinesisVideoMedia) GetMedia(input *GetMediaInput) (*GetMediaOutput, error) { 135 req, out := c.GetMediaRequest(input) 136 return out, req.Send() 137 } 138 139 // GetMediaWithContext is the same as GetMedia with the addition of 140 // the ability to pass a context and additional request options. 141 // 142 // See GetMedia for details on how to use this API operation. 143 // 144 // The context must be non-nil and will be used for request cancellation. If 145 // the context is nil a panic will occur. In the future the SDK may create 146 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 147 // for more information on using Contexts. 148 func (c *KinesisVideoMedia) GetMediaWithContext(ctx aws.Context, input *GetMediaInput, opts ...request.Option) (*GetMediaOutput, error) { 149 req, out := c.GetMediaRequest(input) 150 req.SetContext(ctx) 151 req.ApplyOptions(opts...) 152 return out, req.Send() 153 } 154 155 // Kinesis Video Streams has throttled the request because you have exceeded 156 // the limit of allowed client calls. Try making the call later. 157 type ClientLimitExceededException struct { 158 _ struct{} `type:"structure"` 159 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 160 161 Message_ *string `locationName:"Message" type:"string"` 162 } 163 164 // String returns the string representation. 165 // 166 // API parameter values that are decorated as "sensitive" in the API will not 167 // be included in the string output. The member name will be present, but the 168 // value will be replaced with "sensitive". 169 func (s ClientLimitExceededException) String() string { 170 return awsutil.Prettify(s) 171 } 172 173 // GoString returns the string representation. 174 // 175 // API parameter values that are decorated as "sensitive" in the API will not 176 // be included in the string output. The member name will be present, but the 177 // value will be replaced with "sensitive". 178 func (s ClientLimitExceededException) GoString() string { 179 return s.String() 180 } 181 182 func newErrorClientLimitExceededException(v protocol.ResponseMetadata) error { 183 return &ClientLimitExceededException{ 184 RespMetadata: v, 185 } 186 } 187 188 // Code returns the exception type name. 189 func (s *ClientLimitExceededException) Code() string { 190 return "ClientLimitExceededException" 191 } 192 193 // Message returns the exception's message. 194 func (s *ClientLimitExceededException) Message() string { 195 if s.Message_ != nil { 196 return *s.Message_ 197 } 198 return "" 199 } 200 201 // OrigErr always returns nil, satisfies awserr.Error interface. 202 func (s *ClientLimitExceededException) OrigErr() error { 203 return nil 204 } 205 206 func (s *ClientLimitExceededException) Error() string { 207 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 208 } 209 210 // Status code returns the HTTP status code for the request's response error. 211 func (s *ClientLimitExceededException) StatusCode() int { 212 return s.RespMetadata.StatusCode 213 } 214 215 // RequestID returns the service's response RequestID for request. 216 func (s *ClientLimitExceededException) RequestID() string { 217 return s.RespMetadata.RequestID 218 } 219 220 // Kinesis Video Streams has throttled the request because you have exceeded 221 // the limit of allowed client connections. 222 type ConnectionLimitExceededException struct { 223 _ struct{} `type:"structure"` 224 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 225 226 Message_ *string `locationName:"Message" type:"string"` 227 } 228 229 // String returns the string representation. 230 // 231 // API parameter values that are decorated as "sensitive" in the API will not 232 // be included in the string output. The member name will be present, but the 233 // value will be replaced with "sensitive". 234 func (s ConnectionLimitExceededException) String() string { 235 return awsutil.Prettify(s) 236 } 237 238 // GoString returns the string representation. 239 // 240 // API parameter values that are decorated as "sensitive" in the API will not 241 // be included in the string output. The member name will be present, but the 242 // value will be replaced with "sensitive". 243 func (s ConnectionLimitExceededException) GoString() string { 244 return s.String() 245 } 246 247 func newErrorConnectionLimitExceededException(v protocol.ResponseMetadata) error { 248 return &ConnectionLimitExceededException{ 249 RespMetadata: v, 250 } 251 } 252 253 // Code returns the exception type name. 254 func (s *ConnectionLimitExceededException) Code() string { 255 return "ConnectionLimitExceededException" 256 } 257 258 // Message returns the exception's message. 259 func (s *ConnectionLimitExceededException) Message() string { 260 if s.Message_ != nil { 261 return *s.Message_ 262 } 263 return "" 264 } 265 266 // OrigErr always returns nil, satisfies awserr.Error interface. 267 func (s *ConnectionLimitExceededException) OrigErr() error { 268 return nil 269 } 270 271 func (s *ConnectionLimitExceededException) Error() string { 272 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 273 } 274 275 // Status code returns the HTTP status code for the request's response error. 276 func (s *ConnectionLimitExceededException) StatusCode() int { 277 return s.RespMetadata.StatusCode 278 } 279 280 // RequestID returns the service's response RequestID for request. 281 func (s *ConnectionLimitExceededException) RequestID() string { 282 return s.RespMetadata.RequestID 283 } 284 285 type GetMediaInput struct { 286 _ struct{} `type:"structure"` 287 288 // Identifies the starting chunk to get from the specified stream. 289 // 290 // StartSelector is a required field 291 StartSelector *StartSelector `type:"structure" required:"true"` 292 293 // The ARN of the stream from where you want to get the media content. If you 294 // don't specify the streamARN, you must specify the streamName. 295 StreamARN *string `min:"1" type:"string"` 296 297 // The Kinesis video stream name from where you want to get the media content. 298 // If you don't specify the streamName, you must specify the streamARN. 299 StreamName *string `min:"1" type:"string"` 300 } 301 302 // String returns the string representation. 303 // 304 // API parameter values that are decorated as "sensitive" in the API will not 305 // be included in the string output. The member name will be present, but the 306 // value will be replaced with "sensitive". 307 func (s GetMediaInput) String() string { 308 return awsutil.Prettify(s) 309 } 310 311 // GoString returns the string representation. 312 // 313 // API parameter values that are decorated as "sensitive" in the API will not 314 // be included in the string output. The member name will be present, but the 315 // value will be replaced with "sensitive". 316 func (s GetMediaInput) GoString() string { 317 return s.String() 318 } 319 320 // Validate inspects the fields of the type to determine if they are valid. 321 func (s *GetMediaInput) Validate() error { 322 invalidParams := request.ErrInvalidParams{Context: "GetMediaInput"} 323 if s.StartSelector == nil { 324 invalidParams.Add(request.NewErrParamRequired("StartSelector")) 325 } 326 if s.StreamARN != nil && len(*s.StreamARN) < 1 { 327 invalidParams.Add(request.NewErrParamMinLen("StreamARN", 1)) 328 } 329 if s.StreamName != nil && len(*s.StreamName) < 1 { 330 invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) 331 } 332 if s.StartSelector != nil { 333 if err := s.StartSelector.Validate(); err != nil { 334 invalidParams.AddNested("StartSelector", err.(request.ErrInvalidParams)) 335 } 336 } 337 338 if invalidParams.Len() > 0 { 339 return invalidParams 340 } 341 return nil 342 } 343 344 // SetStartSelector sets the StartSelector field's value. 345 func (s *GetMediaInput) SetStartSelector(v *StartSelector) *GetMediaInput { 346 s.StartSelector = v 347 return s 348 } 349 350 // SetStreamARN sets the StreamARN field's value. 351 func (s *GetMediaInput) SetStreamARN(v string) *GetMediaInput { 352 s.StreamARN = &v 353 return s 354 } 355 356 // SetStreamName sets the StreamName field's value. 357 func (s *GetMediaInput) SetStreamName(v string) *GetMediaInput { 358 s.StreamName = &v 359 return s 360 } 361 362 type GetMediaOutput struct { 363 _ struct{} `type:"structure" payload:"Payload"` 364 365 // The content type of the requested media. 366 ContentType *string `location:"header" locationName:"Content-Type" min:"1" type:"string"` 367 368 // The payload Kinesis Video Streams returns is a sequence of chunks from the 369 // specified stream. For information about the chunks, see . The chunks that 370 // Kinesis Video Streams returns in the GetMedia call also include the following 371 // additional Matroska (MKV) tags: 372 // 373 // * AWS_KINESISVIDEO_CONTINUATION_TOKEN (UTF-8 string) - In the event your 374 // GetMedia call terminates, you can use this continuation token in your 375 // next request to get the next chunk where the last request terminated. 376 // 377 // * AWS_KINESISVIDEO_MILLIS_BEHIND_NOW (UTF-8 string) - Client applications 378 // can use this tag value to determine how far behind the chunk returned 379 // in the response is from the latest chunk on the stream. 380 // 381 // * AWS_KINESISVIDEO_FRAGMENT_NUMBER - Fragment number returned in the chunk. 382 // 383 // * AWS_KINESISVIDEO_SERVER_TIMESTAMP - Server timestamp of the fragment. 384 // 385 // * AWS_KINESISVIDEO_PRODUCER_TIMESTAMP - Producer timestamp of the fragment. 386 // 387 // The following tags will be present if an error occurs: 388 // 389 // * AWS_KINESISVIDEO_ERROR_CODE - String description of an error that caused 390 // GetMedia to stop. 391 // 392 // * AWS_KINESISVIDEO_ERROR_ID: Integer code of the error. 393 // 394 // The error codes are as follows: 395 // 396 // * 3002 - Error writing to the stream 397 // 398 // * 4000 - Requested fragment is not found 399 // 400 // * 4500 - Access denied for the stream's KMS key 401 // 402 // * 4501 - Stream's KMS key is disabled 403 // 404 // * 4502 - Validation error on the stream's KMS key 405 // 406 // * 4503 - KMS key specified in the stream is unavailable 407 // 408 // * 4504 - Invalid usage of the KMS key specified in the stream 409 // 410 // * 4505 - Invalid state of the KMS key specified in the stream 411 // 412 // * 4506 - Unable to find the KMS key specified in the stream 413 // 414 // * 5000 - Internal error 415 Payload io.ReadCloser `type:"blob"` 416 } 417 418 // String returns the string representation. 419 // 420 // API parameter values that are decorated as "sensitive" in the API will not 421 // be included in the string output. The member name will be present, but the 422 // value will be replaced with "sensitive". 423 func (s GetMediaOutput) String() string { 424 return awsutil.Prettify(s) 425 } 426 427 // GoString returns the string representation. 428 // 429 // API parameter values that are decorated as "sensitive" in the API will not 430 // be included in the string output. The member name will be present, but the 431 // value will be replaced with "sensitive". 432 func (s GetMediaOutput) GoString() string { 433 return s.String() 434 } 435 436 // SetContentType sets the ContentType field's value. 437 func (s *GetMediaOutput) SetContentType(v string) *GetMediaOutput { 438 s.ContentType = &v 439 return s 440 } 441 442 // SetPayload sets the Payload field's value. 443 func (s *GetMediaOutput) SetPayload(v io.ReadCloser) *GetMediaOutput { 444 s.Payload = v 445 return s 446 } 447 448 // The value for this input parameter is invalid. 449 type InvalidArgumentException struct { 450 _ struct{} `type:"structure"` 451 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 452 453 Message_ *string `locationName:"Message" type:"string"` 454 } 455 456 // String returns the string representation. 457 // 458 // API parameter values that are decorated as "sensitive" in the API will not 459 // be included in the string output. The member name will be present, but the 460 // value will be replaced with "sensitive". 461 func (s InvalidArgumentException) String() string { 462 return awsutil.Prettify(s) 463 } 464 465 // GoString returns the string representation. 466 // 467 // API parameter values that are decorated as "sensitive" in the API will not 468 // be included in the string output. The member name will be present, but the 469 // value will be replaced with "sensitive". 470 func (s InvalidArgumentException) GoString() string { 471 return s.String() 472 } 473 474 func newErrorInvalidArgumentException(v protocol.ResponseMetadata) error { 475 return &InvalidArgumentException{ 476 RespMetadata: v, 477 } 478 } 479 480 // Code returns the exception type name. 481 func (s *InvalidArgumentException) Code() string { 482 return "InvalidArgumentException" 483 } 484 485 // Message returns the exception's message. 486 func (s *InvalidArgumentException) Message() string { 487 if s.Message_ != nil { 488 return *s.Message_ 489 } 490 return "" 491 } 492 493 // OrigErr always returns nil, satisfies awserr.Error interface. 494 func (s *InvalidArgumentException) OrigErr() error { 495 return nil 496 } 497 498 func (s *InvalidArgumentException) Error() string { 499 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 500 } 501 502 // Status code returns the HTTP status code for the request's response error. 503 func (s *InvalidArgumentException) StatusCode() int { 504 return s.RespMetadata.StatusCode 505 } 506 507 // RequestID returns the service's response RequestID for request. 508 func (s *InvalidArgumentException) RequestID() string { 509 return s.RespMetadata.RequestID 510 } 511 512 // Status Code: 400, Caller used wrong endpoint to write data to a stream. On 513 // receiving such an exception, the user must call GetDataEndpoint with AccessMode 514 // set to "READ" and use the endpoint Kinesis Video returns in the next GetMedia 515 // call. 516 type InvalidEndpointException struct { 517 _ struct{} `type:"structure"` 518 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 519 520 Message_ *string `locationName:"Message" type:"string"` 521 } 522 523 // String returns the string representation. 524 // 525 // API parameter values that are decorated as "sensitive" in the API will not 526 // be included in the string output. The member name will be present, but the 527 // value will be replaced with "sensitive". 528 func (s InvalidEndpointException) String() string { 529 return awsutil.Prettify(s) 530 } 531 532 // GoString returns the string representation. 533 // 534 // API parameter values that are decorated as "sensitive" in the API will not 535 // be included in the string output. The member name will be present, but the 536 // value will be replaced with "sensitive". 537 func (s InvalidEndpointException) GoString() string { 538 return s.String() 539 } 540 541 func newErrorInvalidEndpointException(v protocol.ResponseMetadata) error { 542 return &InvalidEndpointException{ 543 RespMetadata: v, 544 } 545 } 546 547 // Code returns the exception type name. 548 func (s *InvalidEndpointException) Code() string { 549 return "InvalidEndpointException" 550 } 551 552 // Message returns the exception's message. 553 func (s *InvalidEndpointException) Message() string { 554 if s.Message_ != nil { 555 return *s.Message_ 556 } 557 return "" 558 } 559 560 // OrigErr always returns nil, satisfies awserr.Error interface. 561 func (s *InvalidEndpointException) OrigErr() error { 562 return nil 563 } 564 565 func (s *InvalidEndpointException) Error() string { 566 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 567 } 568 569 // Status code returns the HTTP status code for the request's response error. 570 func (s *InvalidEndpointException) StatusCode() int { 571 return s.RespMetadata.StatusCode 572 } 573 574 // RequestID returns the service's response RequestID for request. 575 func (s *InvalidEndpointException) RequestID() string { 576 return s.RespMetadata.RequestID 577 } 578 579 // Status Code: 403, The caller is not authorized to perform an operation on 580 // the given stream, or the token has expired. 581 type NotAuthorizedException struct { 582 _ struct{} `type:"structure"` 583 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 584 585 Message_ *string `locationName:"Message" type:"string"` 586 } 587 588 // String returns the string representation. 589 // 590 // API parameter values that are decorated as "sensitive" in the API will not 591 // be included in the string output. The member name will be present, but the 592 // value will be replaced with "sensitive". 593 func (s NotAuthorizedException) String() string { 594 return awsutil.Prettify(s) 595 } 596 597 // GoString returns the string representation. 598 // 599 // API parameter values that are decorated as "sensitive" in the API will not 600 // be included in the string output. The member name will be present, but the 601 // value will be replaced with "sensitive". 602 func (s NotAuthorizedException) GoString() string { 603 return s.String() 604 } 605 606 func newErrorNotAuthorizedException(v protocol.ResponseMetadata) error { 607 return &NotAuthorizedException{ 608 RespMetadata: v, 609 } 610 } 611 612 // Code returns the exception type name. 613 func (s *NotAuthorizedException) Code() string { 614 return "NotAuthorizedException" 615 } 616 617 // Message returns the exception's message. 618 func (s *NotAuthorizedException) Message() string { 619 if s.Message_ != nil { 620 return *s.Message_ 621 } 622 return "" 623 } 624 625 // OrigErr always returns nil, satisfies awserr.Error interface. 626 func (s *NotAuthorizedException) OrigErr() error { 627 return nil 628 } 629 630 func (s *NotAuthorizedException) Error() string { 631 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 632 } 633 634 // Status code returns the HTTP status code for the request's response error. 635 func (s *NotAuthorizedException) StatusCode() int { 636 return s.RespMetadata.StatusCode 637 } 638 639 // RequestID returns the service's response RequestID for request. 640 func (s *NotAuthorizedException) RequestID() string { 641 return s.RespMetadata.RequestID 642 } 643 644 // Status Code: 404, The stream with the given name does not exist. 645 type ResourceNotFoundException struct { 646 _ struct{} `type:"structure"` 647 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 648 649 Message_ *string `locationName:"Message" type:"string"` 650 } 651 652 // String returns the string representation. 653 // 654 // API parameter values that are decorated as "sensitive" in the API will not 655 // be included in the string output. The member name will be present, but the 656 // value will be replaced with "sensitive". 657 func (s ResourceNotFoundException) String() string { 658 return awsutil.Prettify(s) 659 } 660 661 // GoString returns the string representation. 662 // 663 // API parameter values that are decorated as "sensitive" in the API will not 664 // be included in the string output. The member name will be present, but the 665 // value will be replaced with "sensitive". 666 func (s ResourceNotFoundException) GoString() string { 667 return s.String() 668 } 669 670 func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { 671 return &ResourceNotFoundException{ 672 RespMetadata: v, 673 } 674 } 675 676 // Code returns the exception type name. 677 func (s *ResourceNotFoundException) Code() string { 678 return "ResourceNotFoundException" 679 } 680 681 // Message returns the exception's message. 682 func (s *ResourceNotFoundException) Message() string { 683 if s.Message_ != nil { 684 return *s.Message_ 685 } 686 return "" 687 } 688 689 // OrigErr always returns nil, satisfies awserr.Error interface. 690 func (s *ResourceNotFoundException) OrigErr() error { 691 return nil 692 } 693 694 func (s *ResourceNotFoundException) Error() string { 695 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 696 } 697 698 // Status code returns the HTTP status code for the request's response error. 699 func (s *ResourceNotFoundException) StatusCode() int { 700 return s.RespMetadata.StatusCode 701 } 702 703 // RequestID returns the service's response RequestID for request. 704 func (s *ResourceNotFoundException) RequestID() string { 705 return s.RespMetadata.RequestID 706 } 707 708 // Identifies the chunk on the Kinesis video stream where you want the GetMedia 709 // API to start returning media data. You have the following options to identify 710 // the starting chunk: 711 // 712 // * Choose the latest (or oldest) chunk. 713 // 714 // * Identify a specific chunk. You can identify a specific chunk either 715 // by providing a fragment number or timestamp (server or producer). 716 // 717 // * Each chunk's metadata includes a continuation token as a Matroska (MKV) 718 // tag (AWS_KINESISVIDEO_CONTINUATION_TOKEN). If your previous GetMedia request 719 // terminated, you can use this tag value in your next GetMedia request. 720 // The API then starts returning chunks starting where the last API ended. 721 type StartSelector struct { 722 _ struct{} `type:"structure"` 723 724 // Specifies the fragment number from where you want the GetMedia API to start 725 // returning the fragments. 726 AfterFragmentNumber *string `min:"1" type:"string"` 727 728 // Continuation token that Kinesis Video Streams returned in the previous GetMedia 729 // response. The GetMedia API then starts with the chunk identified by the continuation 730 // token. 731 ContinuationToken *string `min:"1" type:"string"` 732 733 // Identifies the fragment on the Kinesis video stream where you want to start 734 // getting the data from. 735 // 736 // * NOW - Start with the latest chunk on the stream. 737 // 738 // * EARLIEST - Start with earliest available chunk on the stream. 739 // 740 // * FRAGMENT_NUMBER - Start with the chunk after a specific fragment. You 741 // must also specify the AfterFragmentNumber parameter. 742 // 743 // * PRODUCER_TIMESTAMP or SERVER_TIMESTAMP - Start with the chunk containing 744 // a fragment with the specified producer or server timestamp. You specify 745 // the timestamp by adding StartTimestamp. 746 // 747 // * CONTINUATION_TOKEN - Read using the specified continuation token. 748 // 749 // If you choose the NOW, EARLIEST, or CONTINUATION_TOKEN as the startSelectorType, 750 // you don't provide any additional information in the startSelector. 751 // 752 // StartSelectorType is a required field 753 StartSelectorType *string `type:"string" required:"true" enum:"StartSelectorType"` 754 755 // A timestamp value. This value is required if you choose the PRODUCER_TIMESTAMP 756 // or the SERVER_TIMESTAMP as the startSelectorType. The GetMedia API then starts 757 // with the chunk containing the fragment that has the specified timestamp. 758 StartTimestamp *time.Time `type:"timestamp"` 759 } 760 761 // String returns the string representation. 762 // 763 // API parameter values that are decorated as "sensitive" in the API will not 764 // be included in the string output. The member name will be present, but the 765 // value will be replaced with "sensitive". 766 func (s StartSelector) String() string { 767 return awsutil.Prettify(s) 768 } 769 770 // GoString returns the string representation. 771 // 772 // API parameter values that are decorated as "sensitive" in the API will not 773 // be included in the string output. The member name will be present, but the 774 // value will be replaced with "sensitive". 775 func (s StartSelector) GoString() string { 776 return s.String() 777 } 778 779 // Validate inspects the fields of the type to determine if they are valid. 780 func (s *StartSelector) Validate() error { 781 invalidParams := request.ErrInvalidParams{Context: "StartSelector"} 782 if s.AfterFragmentNumber != nil && len(*s.AfterFragmentNumber) < 1 { 783 invalidParams.Add(request.NewErrParamMinLen("AfterFragmentNumber", 1)) 784 } 785 if s.ContinuationToken != nil && len(*s.ContinuationToken) < 1 { 786 invalidParams.Add(request.NewErrParamMinLen("ContinuationToken", 1)) 787 } 788 if s.StartSelectorType == nil { 789 invalidParams.Add(request.NewErrParamRequired("StartSelectorType")) 790 } 791 792 if invalidParams.Len() > 0 { 793 return invalidParams 794 } 795 return nil 796 } 797 798 // SetAfterFragmentNumber sets the AfterFragmentNumber field's value. 799 func (s *StartSelector) SetAfterFragmentNumber(v string) *StartSelector { 800 s.AfterFragmentNumber = &v 801 return s 802 } 803 804 // SetContinuationToken sets the ContinuationToken field's value. 805 func (s *StartSelector) SetContinuationToken(v string) *StartSelector { 806 s.ContinuationToken = &v 807 return s 808 } 809 810 // SetStartSelectorType sets the StartSelectorType field's value. 811 func (s *StartSelector) SetStartSelectorType(v string) *StartSelector { 812 s.StartSelectorType = &v 813 return s 814 } 815 816 // SetStartTimestamp sets the StartTimestamp field's value. 817 func (s *StartSelector) SetStartTimestamp(v time.Time) *StartSelector { 818 s.StartTimestamp = &v 819 return s 820 } 821 822 const ( 823 // StartSelectorTypeFragmentNumber is a StartSelectorType enum value 824 StartSelectorTypeFragmentNumber = "FRAGMENT_NUMBER" 825 826 // StartSelectorTypeServerTimestamp is a StartSelectorType enum value 827 StartSelectorTypeServerTimestamp = "SERVER_TIMESTAMP" 828 829 // StartSelectorTypeProducerTimestamp is a StartSelectorType enum value 830 StartSelectorTypeProducerTimestamp = "PRODUCER_TIMESTAMP" 831 832 // StartSelectorTypeNow is a StartSelectorType enum value 833 StartSelectorTypeNow = "NOW" 834 835 // StartSelectorTypeEarliest is a StartSelectorType enum value 836 StartSelectorTypeEarliest = "EARLIEST" 837 838 // StartSelectorTypeContinuationToken is a StartSelectorType enum value 839 StartSelectorTypeContinuationToken = "CONTINUATION_TOKEN" 840 ) 841 842 // StartSelectorType_Values returns all elements of the StartSelectorType enum 843 func StartSelectorType_Values() []string { 844 return []string{ 845 StartSelectorTypeFragmentNumber, 846 StartSelectorTypeServerTimestamp, 847 StartSelectorTypeProducerTimestamp, 848 StartSelectorTypeNow, 849 StartSelectorTypeEarliest, 850 StartSelectorTypeContinuationToken, 851 } 852 }