Update Go AWS SDK to the latest version

This commit is contained in:
Andrey Smirnov
2019-07-13 00:03:55 +03:00
committed by Andrey Smirnov
parent d08be990ef
commit 94a72b23ff
2183 changed files with 885887 additions and 228114 deletions
+114 -21
View File
@@ -8,6 +8,8 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/restjson"
)
const opCreateStream = "CreateStream"
@@ -15,7 +17,7 @@ const opCreateStream = "CreateStream"
// CreateStreamRequest generates a "aws/request.Request" representing the
// client's request for the CreateStream operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
@@ -62,7 +64,7 @@ func (c *KinesisVideo) CreateStreamRequest(input *CreateStreamInput) (req *reque
//
// CreateStream is an asynchronous operation.
//
// For information about how the service works, see How it Works (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/how-it-works.html).
// For information about how the service works, see How it Works (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/how-it-works.html).
//
// You must have permissions for the KinesisVideo:CreateStream action.
//
@@ -93,6 +95,10 @@ func (c *KinesisVideo) CreateStreamRequest(input *CreateStreamInput) (req *reque
// Kinesis Video Streams has throttled the request because you have exceeded
// the limit of allowed client calls. Try making the call later.
//
// * ErrCodeTagsPerResourceExceededLimitException "TagsPerResourceExceededLimitException"
// You have exceeded the limit of tags that you can associate with the resource.
// Kinesis video streams support up to 50 tags.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/CreateStream
func (c *KinesisVideo) CreateStream(input *CreateStreamInput) (*CreateStreamOutput, error) {
req, out := c.CreateStreamRequest(input)
@@ -120,7 +126,7 @@ const opDeleteStream = "DeleteStream"
// DeleteStreamRequest generates a "aws/request.Request" representing the
// client's request for the DeleteStream operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
@@ -154,6 +160,7 @@ func (c *KinesisVideo) DeleteStreamRequest(input *DeleteStreamInput) (req *reque
output = &DeleteStreamOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -193,6 +200,11 @@ func (c *KinesisVideo) DeleteStreamRequest(input *DeleteStreamInput) (req *reque
// * ErrCodeNotAuthorizedException "NotAuthorizedException"
// The caller is not authorized to perform this operation.
//
// * ErrCodeVersionMismatchException "VersionMismatchException"
// The stream version that you specified is not the latest version. To get the
// latest version, use the DescribeStream (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_DescribeStream.html)
// API.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/DeleteStream
func (c *KinesisVideo) DeleteStream(input *DeleteStreamInput) (*DeleteStreamOutput, error) {
req, out := c.DeleteStreamRequest(input)
@@ -220,7 +232,7 @@ const opDescribeStream = "DescribeStream"
// DescribeStreamRequest generates a "aws/request.Request" representing the
// client's request for the DescribeStream operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
@@ -310,7 +322,7 @@ const opGetDataEndpoint = "GetDataEndpoint"
// GetDataEndpointRequest generates a "aws/request.Request" representing the
// client's request for the GetDataEndpoint operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
@@ -407,7 +419,7 @@ const opListStreams = "ListStreams"
// ListStreamsRequest generates a "aws/request.Request" representing the
// client's request for the ListStreams operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
@@ -433,6 +445,12 @@ func (c *KinesisVideo) ListStreamsRequest(input *ListStreamsInput) (req *request
Name: opListStreams,
HTTPMethod: "POST",
HTTPPath: "/listStreams",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
@@ -487,12 +505,62 @@ func (c *KinesisVideo) ListStreamsWithContext(ctx aws.Context, input *ListStream
return out, req.Send()
}
// ListStreamsPages iterates over the pages of a ListStreams operation,
// calling the "fn" function with the response data for each page. To stop
// iterating, return false from the fn function.
//
// See ListStreams method for more information on how to use this operation.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a ListStreams operation.
// pageNum := 0
// err := client.ListStreamsPages(params,
// func(page *kinesisvideo.ListStreamsOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
// })
//
func (c *KinesisVideo) ListStreamsPages(input *ListStreamsInput, fn func(*ListStreamsOutput, bool) bool) error {
return c.ListStreamsPagesWithContext(aws.BackgroundContext(), input, fn)
}
// ListStreamsPagesWithContext same as ListStreamsPages except
// it takes a Context and allows setting request options on the pages.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *KinesisVideo) ListStreamsPagesWithContext(ctx aws.Context, input *ListStreamsInput, fn func(*ListStreamsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *ListStreamsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListStreamsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
cont := true
for p.Next() && cont {
cont = fn(p.Page().(*ListStreamsOutput), !p.HasNextPage())
}
return p.Err()
}
const opListTagsForStream = "ListTagsForStream"
// ListTagsForStreamRequest generates a "aws/request.Request" representing the
// client's request for the ListTagsForStream operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
@@ -586,7 +654,7 @@ const opTagStream = "TagStream"
// TagStreamRequest generates a "aws/request.Request" representing the
// client's request for the TagStream operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
@@ -620,6 +688,7 @@ func (c *KinesisVideo) TagStreamRequest(input *TagStreamInput) (req *request.Req
output = &TagStreamOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -629,7 +698,7 @@ func (c *KinesisVideo) TagStreamRequest(input *TagStreamInput) (req *request.Req
// optional) that you can define and assign to AWS resources. If you specify
// a tag that already exists, the tag value is replaced with the value that
// you specify in the request. For more information, see Using Cost Allocation
// Tags (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)
// Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)
// in the AWS Billing and Cost Management User Guide.
//
// You must provide either the StreamName or the StreamARN.
@@ -693,7 +762,7 @@ const opUntagStream = "UntagStream"
// UntagStreamRequest generates a "aws/request.Request" representing the
// client's request for the UntagStream operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
@@ -727,6 +796,7 @@ func (c *KinesisVideo) UntagStreamRequest(input *UntagStreamInput) (req *request
output = &UntagStreamOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -789,7 +859,7 @@ const opUpdateDataRetention = "UpdateDataRetention"
// UpdateDataRetentionRequest generates a "aws/request.Request" representing the
// client's request for the UpdateDataRetention operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
@@ -823,6 +893,7 @@ func (c *KinesisVideo) UpdateDataRetentionRequest(input *UpdateDataRetentionInpu
output = &UpdateDataRetentionOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -876,7 +947,7 @@ func (c *KinesisVideo) UpdateDataRetentionRequest(input *UpdateDataRetentionInpu
//
// * ErrCodeVersionMismatchException "VersionMismatchException"
// The stream version that you specified is not the latest version. To get the
// latest version, use the DescribeStream (http://docs.aws.amazon.com/kinesisvideo/latest/dg/API_DescribeStream.html)
// latest version, use the DescribeStream (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_DescribeStream.html)
// API.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UpdateDataRetention
@@ -906,7 +977,7 @@ const opUpdateStream = "UpdateStream"
// UpdateStreamRequest generates a "aws/request.Request" representing the
// client's request for the UpdateStream operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
@@ -940,6 +1011,7 @@ func (c *KinesisVideo) UpdateStreamRequest(input *UpdateStreamInput) (req *reque
output = &UpdateStreamOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -984,7 +1056,7 @@ func (c *KinesisVideo) UpdateStreamRequest(input *UpdateStreamInput) (req *reque
//
// * ErrCodeVersionMismatchException "VersionMismatchException"
// The stream version that you specified is not the latest version. To get the
// latest version, use the DescribeStream (http://docs.aws.amazon.com/kinesisvideo/latest/dg/API_DescribeStream.html)
// latest version, use the DescribeStream (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_DescribeStream.html)
// API.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UpdateStream
@@ -1017,6 +1089,11 @@ type CreateStreamInput struct {
// stream.
//
// The default value is 0, indicating that the stream does not persist data.
//
// When the DataRetentionInHours value is 0, consumers can still consume the
// fragments that remain in the service host buffer, which has a retention time
// limit of 5 minutes and a retention memory limit of 200 MB. Fragments are
// removed from the buffer when either limit is reached.
DataRetentionInHours *int64 `type:"integer"`
// The name of the device that is writing to the stream.
@@ -1030,7 +1107,7 @@ type CreateStreamInput struct {
// If no key ID is specified, the default, Kinesis Video-managed key (aws/kinesisvideo)
// is used.
//
// For more information, see DescribeKey (http://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters).
// For more information, see DescribeKey (https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters).
KmsKeyId *string `min:"1" type:"string"`
// The media type of the stream. Consumers of the stream can use this information
@@ -1039,9 +1116,6 @@ type CreateStreamInput struct {
// you choose to specify the MediaType, see Naming Requirements (https://tools.ietf.org/html/rfc6838#section-4.2)
// for guidelines.
//
// To play video on the console, the media must be H.264 encoded, and you need
// to specify this video type in this parameter as video/h264.
//
// This parameter is optional; the default value is null (or empty in JSON).
MediaType *string `min:"1" type:"string"`
@@ -1052,6 +1126,10 @@ type CreateStreamInput struct {
//
// StreamName is a required field
StreamName *string `min:"1" type:"string" required:"true"`
// A list of tags to associate with the specified stream. Each tag is a key-value
// pair (the value is optional).
Tags map[string]*string `min:"1" type:"map"`
}
// String returns the string representation
@@ -1082,6 +1160,9 @@ func (s *CreateStreamInput) Validate() error {
if s.StreamName != nil && len(*s.StreamName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StreamName", 1))
}
if s.Tags != nil && len(s.Tags) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Tags", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
@@ -1119,6 +1200,12 @@ func (s *CreateStreamInput) SetStreamName(v string) *CreateStreamInput {
return s
}
// SetTags sets the Tags field's value.
func (s *CreateStreamInput) SetTags(v map[string]*string) *CreateStreamInput {
s.Tags = v
return s
}
type CreateStreamOutput struct {
_ struct{} `type:"structure"`
@@ -1566,7 +1653,7 @@ type StreamInfo struct {
_ struct{} `type:"structure"`
// A time stamp that indicates when the stream was created.
CreationTime *time.Time `type:"timestamp" timestampFormat:"unix"`
CreationTime *time.Time `type:"timestamp"`
// How long the stream retains data, in hours.
DataRetentionInHours *int64 `type:"integer"`
@@ -1879,7 +1966,7 @@ type UpdateDataRetentionInput struct {
CurrentVersion *string `min:"1" type:"string" required:"true"`
// The retention period, in hours. The value you specify replaces the current
// value.
// value. The maximum value for this parameter is 87600 (ten years).
//
// DataRetentionChangeInHours is a required field
DataRetentionChangeInHours *int64 `min:"1" type:"integer" required:"true"`
@@ -1998,7 +2085,7 @@ type UpdateStreamInput struct {
// The stream's media type. Use MediaType to specify the type of content that
// the stream contains to the consumers of the stream. For more information
// about media types, see Media Types (http://www.iana.org/assignments/media-types/media-types.xhtml).
// If you choose to specify the MediaType, see Naming Requirements (https://tools.sietf.org/html/rfc6838#section-4.2).
// If you choose to specify the MediaType, see Naming Requirements (https://tools.ietf.org/html/rfc6838#section-4.2).
//
// To play video on the console, you must specify the correct video type. For
// example, if the video in the stream is H.264, specify video/h264 as the MediaType.
@@ -2108,6 +2195,12 @@ const (
// APINameGetMediaForFragmentList is a APIName enum value
APINameGetMediaForFragmentList = "GET_MEDIA_FOR_FRAGMENT_LIST"
// APINameGetHlsStreamingSessionUrl is a APIName enum value
APINameGetHlsStreamingSessionUrl = "GET_HLS_STREAMING_SESSION_URL"
// APINameGetDashStreamingSessionUrl is a APIName enum value
APINameGetDashStreamingSessionUrl = "GET_DASH_STREAMING_SESSION_URL"
)
const (