1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3package kinesisvideomedia 4 5import ( 6 "fmt" 7 "io" 8 "time" 9 10 "github.com/aws/aws-sdk-go/aws" 11 "github.com/aws/aws-sdk-go/aws/awsutil" 12 "github.com/aws/aws-sdk-go/aws/request" 13 "github.com/aws/aws-sdk-go/private/protocol" 14) 15 16const 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 42func (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 134func (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. 148func (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. 157type 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 165func (s ClientLimitExceededException) String() string { 166 return awsutil.Prettify(s) 167} 168 169// GoString returns the string representation 170func (s ClientLimitExceededException) GoString() string { 171 return s.String() 172} 173 174func newErrorClientLimitExceededException(v protocol.ResponseMetadata) error { 175 return &ClientLimitExceededException{ 176 RespMetadata: v, 177 } 178} 179 180// Code returns the exception type name. 181func (s *ClientLimitExceededException) Code() string { 182 return "ClientLimitExceededException" 183} 184 185// Message returns the exception's message. 186func (s *ClientLimitExceededException) Message() string { 187 if s.Message_ != nil { 188 return *s.Message_ 189 } 190 return "" 191} 192 193// OrigErr always returns nil, satisfies awserr.Error interface. 194func (s *ClientLimitExceededException) OrigErr() error { 195 return nil 196} 197 198func (s *ClientLimitExceededException) Error() string { 199 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 200} 201 202// Status code returns the HTTP status code for the request's response error. 203func (s *ClientLimitExceededException) StatusCode() int { 204 return s.RespMetadata.StatusCode 205} 206 207// RequestID returns the service's response RequestID for request. 208func (s *ClientLimitExceededException) RequestID() string { 209 return s.RespMetadata.RequestID 210} 211 212// Kinesis Video Streams has throttled the request because you have exceeded 213// the limit of allowed client connections. 214type ConnectionLimitExceededException struct { 215 _ struct{} `type:"structure"` 216 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 217 218 Message_ *string `locationName:"Message" type:"string"` 219} 220 221// String returns the string representation 222func (s ConnectionLimitExceededException) String() string { 223 return awsutil.Prettify(s) 224} 225 226// GoString returns the string representation 227func (s ConnectionLimitExceededException) GoString() string { 228 return s.String() 229} 230 231func newErrorConnectionLimitExceededException(v protocol.ResponseMetadata) error { 232 return &ConnectionLimitExceededException{ 233 RespMetadata: v, 234 } 235} 236 237// Code returns the exception type name. 238func (s *ConnectionLimitExceededException) Code() string { 239 return "ConnectionLimitExceededException" 240} 241 242// Message returns the exception's message. 243func (s *ConnectionLimitExceededException) Message() string { 244 if s.Message_ != nil { 245 return *s.Message_ 246 } 247 return "" 248} 249 250// OrigErr always returns nil, satisfies awserr.Error interface. 251func (s *ConnectionLimitExceededException) OrigErr() error { 252 return nil 253} 254 255func (s *ConnectionLimitExceededException) Error() string { 256 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 257} 258 259// Status code returns the HTTP status code for the request's response error. 260func (s *ConnectionLimitExceededException) StatusCode() int { 261 return s.RespMetadata.StatusCode 262} 263 264// RequestID returns the service's response RequestID for request. 265func (s *ConnectionLimitExceededException) RequestID() string { 266 return s.RespMetadata.RequestID 267} 268 269type GetMediaInput struct { 270 _ struct{} `type:"structure"` 271 272 // Identifies the starting chunk to get from the specified stream. 273 // 274 // StartSelector is a required field 275 StartSelector *StartSelector `type:"structure" required:"true"` 276 277 // The ARN of the stream from where you want to get the media content. If you 278 // don't specify the streamARN, you must specify the streamName. 279 StreamARN *string `min:"1" type:"string"` 280 281 // The Kinesis video stream name from where you want to get the media content. 282 // If you don't specify the streamName, you must specify the streamARN. 283 StreamName *string `min:"1" type:"string"` 284} 285 286// String returns the string representation 287func (s GetMediaInput) String() string { 288 return awsutil.Prettify(s) 289} 290 291// GoString returns the string representation 292func (s GetMediaInput) GoString() string { 293 return s.String() 294} 295 296// Validate inspects the fields of the type to determine if they are valid. 297func (s *GetMediaInput) Validate() error { 298 invalidParams := request.ErrInvalidParams{Context: "GetMediaInput"} 299 if s.StartSelector == nil { 300 invalidParams.Add(request.NewErrParamRequired("StartSelector")) 301 } 302 if s.StreamARN != nil && len(*s.StreamARN) < 1 { 303 invalidParams.Add(request.NewErrParamMinLen("StreamARN", 1)) 304 } 305 if s.StreamName != nil && len(*s.StreamName) < 1 { 306 invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) 307 } 308 if s.StartSelector != nil { 309 if err := s.StartSelector.Validate(); err != nil { 310 invalidParams.AddNested("StartSelector", err.(request.ErrInvalidParams)) 311 } 312 } 313 314 if invalidParams.Len() > 0 { 315 return invalidParams 316 } 317 return nil 318} 319 320// SetStartSelector sets the StartSelector field's value. 321func (s *GetMediaInput) SetStartSelector(v *StartSelector) *GetMediaInput { 322 s.StartSelector = v 323 return s 324} 325 326// SetStreamARN sets the StreamARN field's value. 327func (s *GetMediaInput) SetStreamARN(v string) *GetMediaInput { 328 s.StreamARN = &v 329 return s 330} 331 332// SetStreamName sets the StreamName field's value. 333func (s *GetMediaInput) SetStreamName(v string) *GetMediaInput { 334 s.StreamName = &v 335 return s 336} 337 338type GetMediaOutput struct { 339 _ struct{} `type:"structure" payload:"Payload"` 340 341 // The content type of the requested media. 342 ContentType *string `location:"header" locationName:"Content-Type" min:"1" type:"string"` 343 344 // The payload Kinesis Video Streams returns is a sequence of chunks from the 345 // specified stream. For information about the chunks, see . The chunks that 346 // Kinesis Video Streams returns in the GetMedia call also include the following 347 // additional Matroska (MKV) tags: 348 // 349 // * AWS_KINESISVIDEO_CONTINUATION_TOKEN (UTF-8 string) - In the event your 350 // GetMedia call terminates, you can use this continuation token in your 351 // next request to get the next chunk where the last request terminated. 352 // 353 // * AWS_KINESISVIDEO_MILLIS_BEHIND_NOW (UTF-8 string) - Client applications 354 // can use this tag value to determine how far behind the chunk returned 355 // in the response is from the latest chunk on the stream. 356 // 357 // * AWS_KINESISVIDEO_FRAGMENT_NUMBER - Fragment number returned in the chunk. 358 // 359 // * AWS_KINESISVIDEO_SERVER_TIMESTAMP - Server timestamp of the fragment. 360 // 361 // * AWS_KINESISVIDEO_PRODUCER_TIMESTAMP - Producer timestamp of the fragment. 362 // 363 // The following tags will be present if an error occurs: 364 // 365 // * AWS_KINESISVIDEO_ERROR_CODE - String description of an error that caused 366 // GetMedia to stop. 367 // 368 // * AWS_KINESISVIDEO_ERROR_ID: Integer code of the error. 369 // 370 // The error codes are as follows: 371 // 372 // * 3002 - Error writing to the stream 373 // 374 // * 4000 - Requested fragment is not found 375 // 376 // * 4500 - Access denied for the stream's KMS key 377 // 378 // * 4501 - Stream's KMS key is disabled 379 // 380 // * 4502 - Validation error on the stream's KMS key 381 // 382 // * 4503 - KMS key specified in the stream is unavailable 383 // 384 // * 4504 - Invalid usage of the KMS key specified in the stream 385 // 386 // * 4505 - Invalid state of the KMS key specified in the stream 387 // 388 // * 4506 - Unable to find the KMS key specified in the stream 389 // 390 // * 5000 - Internal error 391 Payload io.ReadCloser `type:"blob"` 392} 393 394// String returns the string representation 395func (s GetMediaOutput) String() string { 396 return awsutil.Prettify(s) 397} 398 399// GoString returns the string representation 400func (s GetMediaOutput) GoString() string { 401 return s.String() 402} 403 404// SetContentType sets the ContentType field's value. 405func (s *GetMediaOutput) SetContentType(v string) *GetMediaOutput { 406 s.ContentType = &v 407 return s 408} 409 410// SetPayload sets the Payload field's value. 411func (s *GetMediaOutput) SetPayload(v io.ReadCloser) *GetMediaOutput { 412 s.Payload = v 413 return s 414} 415 416// The value for this input parameter is invalid. 417type InvalidArgumentException struct { 418 _ struct{} `type:"structure"` 419 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 420 421 Message_ *string `locationName:"Message" type:"string"` 422} 423 424// String returns the string representation 425func (s InvalidArgumentException) String() string { 426 return awsutil.Prettify(s) 427} 428 429// GoString returns the string representation 430func (s InvalidArgumentException) GoString() string { 431 return s.String() 432} 433 434func newErrorInvalidArgumentException(v protocol.ResponseMetadata) error { 435 return &InvalidArgumentException{ 436 RespMetadata: v, 437 } 438} 439 440// Code returns the exception type name. 441func (s *InvalidArgumentException) Code() string { 442 return "InvalidArgumentException" 443} 444 445// Message returns the exception's message. 446func (s *InvalidArgumentException) Message() string { 447 if s.Message_ != nil { 448 return *s.Message_ 449 } 450 return "" 451} 452 453// OrigErr always returns nil, satisfies awserr.Error interface. 454func (s *InvalidArgumentException) OrigErr() error { 455 return nil 456} 457 458func (s *InvalidArgumentException) Error() string { 459 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 460} 461 462// Status code returns the HTTP status code for the request's response error. 463func (s *InvalidArgumentException) StatusCode() int { 464 return s.RespMetadata.StatusCode 465} 466 467// RequestID returns the service's response RequestID for request. 468func (s *InvalidArgumentException) RequestID() string { 469 return s.RespMetadata.RequestID 470} 471 472// Status Code: 400, Caller used wrong endpoint to write data to a stream. On 473// receiving such an exception, the user must call GetDataEndpoint with AccessMode 474// set to "READ" and use the endpoint Kinesis Video returns in the next GetMedia 475// call. 476type InvalidEndpointException struct { 477 _ struct{} `type:"structure"` 478 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 479 480 Message_ *string `locationName:"Message" type:"string"` 481} 482 483// String returns the string representation 484func (s InvalidEndpointException) String() string { 485 return awsutil.Prettify(s) 486} 487 488// GoString returns the string representation 489func (s InvalidEndpointException) GoString() string { 490 return s.String() 491} 492 493func newErrorInvalidEndpointException(v protocol.ResponseMetadata) error { 494 return &InvalidEndpointException{ 495 RespMetadata: v, 496 } 497} 498 499// Code returns the exception type name. 500func (s *InvalidEndpointException) Code() string { 501 return "InvalidEndpointException" 502} 503 504// Message returns the exception's message. 505func (s *InvalidEndpointException) Message() string { 506 if s.Message_ != nil { 507 return *s.Message_ 508 } 509 return "" 510} 511 512// OrigErr always returns nil, satisfies awserr.Error interface. 513func (s *InvalidEndpointException) OrigErr() error { 514 return nil 515} 516 517func (s *InvalidEndpointException) Error() string { 518 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 519} 520 521// Status code returns the HTTP status code for the request's response error. 522func (s *InvalidEndpointException) StatusCode() int { 523 return s.RespMetadata.StatusCode 524} 525 526// RequestID returns the service's response RequestID for request. 527func (s *InvalidEndpointException) RequestID() string { 528 return s.RespMetadata.RequestID 529} 530 531// Status Code: 403, The caller is not authorized to perform an operation on 532// the given stream, or the token has expired. 533type NotAuthorizedException struct { 534 _ struct{} `type:"structure"` 535 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 536 537 Message_ *string `locationName:"Message" type:"string"` 538} 539 540// String returns the string representation 541func (s NotAuthorizedException) String() string { 542 return awsutil.Prettify(s) 543} 544 545// GoString returns the string representation 546func (s NotAuthorizedException) GoString() string { 547 return s.String() 548} 549 550func newErrorNotAuthorizedException(v protocol.ResponseMetadata) error { 551 return &NotAuthorizedException{ 552 RespMetadata: v, 553 } 554} 555 556// Code returns the exception type name. 557func (s *NotAuthorizedException) Code() string { 558 return "NotAuthorizedException" 559} 560 561// Message returns the exception's message. 562func (s *NotAuthorizedException) Message() string { 563 if s.Message_ != nil { 564 return *s.Message_ 565 } 566 return "" 567} 568 569// OrigErr always returns nil, satisfies awserr.Error interface. 570func (s *NotAuthorizedException) OrigErr() error { 571 return nil 572} 573 574func (s *NotAuthorizedException) Error() string { 575 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 576} 577 578// Status code returns the HTTP status code for the request's response error. 579func (s *NotAuthorizedException) StatusCode() int { 580 return s.RespMetadata.StatusCode 581} 582 583// RequestID returns the service's response RequestID for request. 584func (s *NotAuthorizedException) RequestID() string { 585 return s.RespMetadata.RequestID 586} 587 588// Status Code: 404, The stream with the given name does not exist. 589type ResourceNotFoundException struct { 590 _ struct{} `type:"structure"` 591 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 592 593 Message_ *string `locationName:"Message" type:"string"` 594} 595 596// String returns the string representation 597func (s ResourceNotFoundException) String() string { 598 return awsutil.Prettify(s) 599} 600 601// GoString returns the string representation 602func (s ResourceNotFoundException) GoString() string { 603 return s.String() 604} 605 606func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { 607 return &ResourceNotFoundException{ 608 RespMetadata: v, 609 } 610} 611 612// Code returns the exception type name. 613func (s *ResourceNotFoundException) Code() string { 614 return "ResourceNotFoundException" 615} 616 617// Message returns the exception's message. 618func (s *ResourceNotFoundException) 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. 626func (s *ResourceNotFoundException) OrigErr() error { 627 return nil 628} 629 630func (s *ResourceNotFoundException) 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. 635func (s *ResourceNotFoundException) StatusCode() int { 636 return s.RespMetadata.StatusCode 637} 638 639// RequestID returns the service's response RequestID for request. 640func (s *ResourceNotFoundException) RequestID() string { 641 return s.RespMetadata.RequestID 642} 643 644// Identifies the chunk on the Kinesis video stream where you want the GetMedia 645// API to start returning media data. You have the following options to identify 646// the starting chunk: 647// 648// * Choose the latest (or oldest) chunk. 649// 650// * Identify a specific chunk. You can identify a specific chunk either 651// by providing a fragment number or timestamp (server or producer). 652// 653// * Each chunk's metadata includes a continuation token as a Matroska (MKV) 654// tag (AWS_KINESISVIDEO_CONTINUATION_TOKEN). If your previous GetMedia request 655// terminated, you can use this tag value in your next GetMedia request. 656// The API then starts returning chunks starting where the last API ended. 657type StartSelector struct { 658 _ struct{} `type:"structure"` 659 660 // Specifies the fragment number from where you want the GetMedia API to start 661 // returning the fragments. 662 AfterFragmentNumber *string `min:"1" type:"string"` 663 664 // Continuation token that Kinesis Video Streams returned in the previous GetMedia 665 // response. The GetMedia API then starts with the chunk identified by the continuation 666 // token. 667 ContinuationToken *string `min:"1" type:"string"` 668 669 // Identifies the fragment on the Kinesis video stream where you want to start 670 // getting the data from. 671 // 672 // * NOW - Start with the latest chunk on the stream. 673 // 674 // * EARLIEST - Start with earliest available chunk on the stream. 675 // 676 // * FRAGMENT_NUMBER - Start with the chunk after a specific fragment. You 677 // must also specify the AfterFragmentNumber parameter. 678 // 679 // * PRODUCER_TIMESTAMP or SERVER_TIMESTAMP - Start with the chunk containing 680 // a fragment with the specified producer or server timestamp. You specify 681 // the timestamp by adding StartTimestamp. 682 // 683 // * CONTINUATION_TOKEN - Read using the specified continuation token. 684 // 685 // If you choose the NOW, EARLIEST, or CONTINUATION_TOKEN as the startSelectorType, 686 // you don't provide any additional information in the startSelector. 687 // 688 // StartSelectorType is a required field 689 StartSelectorType *string `type:"string" required:"true" enum:"StartSelectorType"` 690 691 // A timestamp value. This value is required if you choose the PRODUCER_TIMESTAMP 692 // or the SERVER_TIMESTAMP as the startSelectorType. The GetMedia API then starts 693 // with the chunk containing the fragment that has the specified timestamp. 694 StartTimestamp *time.Time `type:"timestamp"` 695} 696 697// String returns the string representation 698func (s StartSelector) String() string { 699 return awsutil.Prettify(s) 700} 701 702// GoString returns the string representation 703func (s StartSelector) GoString() string { 704 return s.String() 705} 706 707// Validate inspects the fields of the type to determine if they are valid. 708func (s *StartSelector) Validate() error { 709 invalidParams := request.ErrInvalidParams{Context: "StartSelector"} 710 if s.AfterFragmentNumber != nil && len(*s.AfterFragmentNumber) < 1 { 711 invalidParams.Add(request.NewErrParamMinLen("AfterFragmentNumber", 1)) 712 } 713 if s.ContinuationToken != nil && len(*s.ContinuationToken) < 1 { 714 invalidParams.Add(request.NewErrParamMinLen("ContinuationToken", 1)) 715 } 716 if s.StartSelectorType == nil { 717 invalidParams.Add(request.NewErrParamRequired("StartSelectorType")) 718 } 719 720 if invalidParams.Len() > 0 { 721 return invalidParams 722 } 723 return nil 724} 725 726// SetAfterFragmentNumber sets the AfterFragmentNumber field's value. 727func (s *StartSelector) SetAfterFragmentNumber(v string) *StartSelector { 728 s.AfterFragmentNumber = &v 729 return s 730} 731 732// SetContinuationToken sets the ContinuationToken field's value. 733func (s *StartSelector) SetContinuationToken(v string) *StartSelector { 734 s.ContinuationToken = &v 735 return s 736} 737 738// SetStartSelectorType sets the StartSelectorType field's value. 739func (s *StartSelector) SetStartSelectorType(v string) *StartSelector { 740 s.StartSelectorType = &v 741 return s 742} 743 744// SetStartTimestamp sets the StartTimestamp field's value. 745func (s *StartSelector) SetStartTimestamp(v time.Time) *StartSelector { 746 s.StartTimestamp = &v 747 return s 748} 749 750const ( 751 // StartSelectorTypeFragmentNumber is a StartSelectorType enum value 752 StartSelectorTypeFragmentNumber = "FRAGMENT_NUMBER" 753 754 // StartSelectorTypeServerTimestamp is a StartSelectorType enum value 755 StartSelectorTypeServerTimestamp = "SERVER_TIMESTAMP" 756 757 // StartSelectorTypeProducerTimestamp is a StartSelectorType enum value 758 StartSelectorTypeProducerTimestamp = "PRODUCER_TIMESTAMP" 759 760 // StartSelectorTypeNow is a StartSelectorType enum value 761 StartSelectorTypeNow = "NOW" 762 763 // StartSelectorTypeEarliest is a StartSelectorType enum value 764 StartSelectorTypeEarliest = "EARLIEST" 765 766 // StartSelectorTypeContinuationToken is a StartSelectorType enum value 767 StartSelectorTypeContinuationToken = "CONTINUATION_TOKEN" 768) 769