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
File diff suppressed because it is too large Load Diff
@@ -26,7 +26,7 @@ import (
// // myFunc uses an SDK service client to make a request to
// // AWS Elemental MediaLive.
// func myFunc(svc medialiveiface.MediaLiveAPI) bool {
// // Make svc.CreateChannel request
// // Make svc.BatchUpdateSchedule request
// }
//
// func main() {
@@ -42,7 +42,7 @@ import (
// type mockMediaLiveClient struct {
// medialiveiface.MediaLiveAPI
// }
// func (m *mockMediaLiveClient) CreateChannel(input *medialive.CreateChannelInput) (*medialive.CreateChannelOutput, error) {
// func (m *mockMediaLiveClient) BatchUpdateSchedule(input *medialive.BatchUpdateScheduleInput) (*medialive.BatchUpdateScheduleOutput, error) {
// // mock response/functionality
// }
//
@@ -60,6 +60,10 @@ import (
// and waiters. Its suggested to use the pattern above for testing, or using
// tooling to generate mocks to satisfy the interfaces.
type MediaLiveAPI interface {
BatchUpdateSchedule(*medialive.BatchUpdateScheduleInput) (*medialive.BatchUpdateScheduleOutput, error)
BatchUpdateScheduleWithContext(aws.Context, *medialive.BatchUpdateScheduleInput, ...request.Option) (*medialive.BatchUpdateScheduleOutput, error)
BatchUpdateScheduleRequest(*medialive.BatchUpdateScheduleInput) (*request.Request, *medialive.BatchUpdateScheduleOutput)
CreateChannel(*medialive.CreateChannelInput) (*medialive.CreateChannelOutput, error)
CreateChannelWithContext(aws.Context, *medialive.CreateChannelInput, ...request.Option) (*medialive.CreateChannelOutput, error)
CreateChannelRequest(*medialive.CreateChannelInput) (*request.Request, *medialive.CreateChannelOutput)
@@ -72,6 +76,10 @@ type MediaLiveAPI interface {
CreateInputSecurityGroupWithContext(aws.Context, *medialive.CreateInputSecurityGroupInput, ...request.Option) (*medialive.CreateInputSecurityGroupOutput, error)
CreateInputSecurityGroupRequest(*medialive.CreateInputSecurityGroupInput) (*request.Request, *medialive.CreateInputSecurityGroupOutput)
CreateTags(*medialive.CreateTagsInput) (*medialive.CreateTagsOutput, error)
CreateTagsWithContext(aws.Context, *medialive.CreateTagsInput, ...request.Option) (*medialive.CreateTagsOutput, error)
CreateTagsRequest(*medialive.CreateTagsInput) (*request.Request, *medialive.CreateTagsOutput)
DeleteChannel(*medialive.DeleteChannelInput) (*medialive.DeleteChannelOutput, error)
DeleteChannelWithContext(aws.Context, *medialive.DeleteChannelInput, ...request.Option) (*medialive.DeleteChannelOutput, error)
DeleteChannelRequest(*medialive.DeleteChannelInput) (*request.Request, *medialive.DeleteChannelOutput)
@@ -84,6 +92,18 @@ type MediaLiveAPI interface {
DeleteInputSecurityGroupWithContext(aws.Context, *medialive.DeleteInputSecurityGroupInput, ...request.Option) (*medialive.DeleteInputSecurityGroupOutput, error)
DeleteInputSecurityGroupRequest(*medialive.DeleteInputSecurityGroupInput) (*request.Request, *medialive.DeleteInputSecurityGroupOutput)
DeleteReservation(*medialive.DeleteReservationInput) (*medialive.DeleteReservationOutput, error)
DeleteReservationWithContext(aws.Context, *medialive.DeleteReservationInput, ...request.Option) (*medialive.DeleteReservationOutput, error)
DeleteReservationRequest(*medialive.DeleteReservationInput) (*request.Request, *medialive.DeleteReservationOutput)
DeleteSchedule(*medialive.DeleteScheduleInput) (*medialive.DeleteScheduleOutput, error)
DeleteScheduleWithContext(aws.Context, *medialive.DeleteScheduleInput, ...request.Option) (*medialive.DeleteScheduleOutput, error)
DeleteScheduleRequest(*medialive.DeleteScheduleInput) (*request.Request, *medialive.DeleteScheduleOutput)
DeleteTags(*medialive.DeleteTagsInput) (*medialive.DeleteTagsOutput, error)
DeleteTagsWithContext(aws.Context, *medialive.DeleteTagsInput, ...request.Option) (*medialive.DeleteTagsOutput, error)
DeleteTagsRequest(*medialive.DeleteTagsInput) (*request.Request, *medialive.DeleteTagsOutput)
DescribeChannel(*medialive.DescribeChannelInput) (*medialive.DescribeChannelOutput, error)
DescribeChannelWithContext(aws.Context, *medialive.DescribeChannelInput, ...request.Option) (*medialive.DescribeChannelOutput, error)
DescribeChannelRequest(*medialive.DescribeChannelInput) (*request.Request, *medialive.DescribeChannelOutput)
@@ -96,6 +116,21 @@ type MediaLiveAPI interface {
DescribeInputSecurityGroupWithContext(aws.Context, *medialive.DescribeInputSecurityGroupInput, ...request.Option) (*medialive.DescribeInputSecurityGroupOutput, error)
DescribeInputSecurityGroupRequest(*medialive.DescribeInputSecurityGroupInput) (*request.Request, *medialive.DescribeInputSecurityGroupOutput)
DescribeOffering(*medialive.DescribeOfferingInput) (*medialive.DescribeOfferingOutput, error)
DescribeOfferingWithContext(aws.Context, *medialive.DescribeOfferingInput, ...request.Option) (*medialive.DescribeOfferingOutput, error)
DescribeOfferingRequest(*medialive.DescribeOfferingInput) (*request.Request, *medialive.DescribeOfferingOutput)
DescribeReservation(*medialive.DescribeReservationInput) (*medialive.DescribeReservationOutput, error)
DescribeReservationWithContext(aws.Context, *medialive.DescribeReservationInput, ...request.Option) (*medialive.DescribeReservationOutput, error)
DescribeReservationRequest(*medialive.DescribeReservationInput) (*request.Request, *medialive.DescribeReservationOutput)
DescribeSchedule(*medialive.DescribeScheduleInput) (*medialive.DescribeScheduleOutput, error)
DescribeScheduleWithContext(aws.Context, *medialive.DescribeScheduleInput, ...request.Option) (*medialive.DescribeScheduleOutput, error)
DescribeScheduleRequest(*medialive.DescribeScheduleInput) (*request.Request, *medialive.DescribeScheduleOutput)
DescribeSchedulePages(*medialive.DescribeScheduleInput, func(*medialive.DescribeScheduleOutput, bool) bool) error
DescribeSchedulePagesWithContext(aws.Context, *medialive.DescribeScheduleInput, func(*medialive.DescribeScheduleOutput, bool) bool, ...request.Option) error
ListChannels(*medialive.ListChannelsInput) (*medialive.ListChannelsOutput, error)
ListChannelsWithContext(aws.Context, *medialive.ListChannelsInput, ...request.Option) (*medialive.ListChannelsOutput, error)
ListChannelsRequest(*medialive.ListChannelsInput) (*request.Request, *medialive.ListChannelsOutput)
@@ -117,6 +152,28 @@ type MediaLiveAPI interface {
ListInputsPages(*medialive.ListInputsInput, func(*medialive.ListInputsOutput, bool) bool) error
ListInputsPagesWithContext(aws.Context, *medialive.ListInputsInput, func(*medialive.ListInputsOutput, bool) bool, ...request.Option) error
ListOfferings(*medialive.ListOfferingsInput) (*medialive.ListOfferingsOutput, error)
ListOfferingsWithContext(aws.Context, *medialive.ListOfferingsInput, ...request.Option) (*medialive.ListOfferingsOutput, error)
ListOfferingsRequest(*medialive.ListOfferingsInput) (*request.Request, *medialive.ListOfferingsOutput)
ListOfferingsPages(*medialive.ListOfferingsInput, func(*medialive.ListOfferingsOutput, bool) bool) error
ListOfferingsPagesWithContext(aws.Context, *medialive.ListOfferingsInput, func(*medialive.ListOfferingsOutput, bool) bool, ...request.Option) error
ListReservations(*medialive.ListReservationsInput) (*medialive.ListReservationsOutput, error)
ListReservationsWithContext(aws.Context, *medialive.ListReservationsInput, ...request.Option) (*medialive.ListReservationsOutput, error)
ListReservationsRequest(*medialive.ListReservationsInput) (*request.Request, *medialive.ListReservationsOutput)
ListReservationsPages(*medialive.ListReservationsInput, func(*medialive.ListReservationsOutput, bool) bool) error
ListReservationsPagesWithContext(aws.Context, *medialive.ListReservationsInput, func(*medialive.ListReservationsOutput, bool) bool, ...request.Option) error
ListTagsForResource(*medialive.ListTagsForResourceInput) (*medialive.ListTagsForResourceOutput, error)
ListTagsForResourceWithContext(aws.Context, *medialive.ListTagsForResourceInput, ...request.Option) (*medialive.ListTagsForResourceOutput, error)
ListTagsForResourceRequest(*medialive.ListTagsForResourceInput) (*request.Request, *medialive.ListTagsForResourceOutput)
PurchaseOffering(*medialive.PurchaseOfferingInput) (*medialive.PurchaseOfferingOutput, error)
PurchaseOfferingWithContext(aws.Context, *medialive.PurchaseOfferingInput, ...request.Option) (*medialive.PurchaseOfferingOutput, error)
PurchaseOfferingRequest(*medialive.PurchaseOfferingInput) (*request.Request, *medialive.PurchaseOfferingOutput)
StartChannel(*medialive.StartChannelInput) (*medialive.StartChannelOutput, error)
StartChannelWithContext(aws.Context, *medialive.StartChannelInput, ...request.Option) (*medialive.StartChannelOutput, error)
StartChannelRequest(*medialive.StartChannelInput) (*request.Request, *medialive.StartChannelOutput)
@@ -129,6 +186,10 @@ type MediaLiveAPI interface {
UpdateChannelWithContext(aws.Context, *medialive.UpdateChannelInput, ...request.Option) (*medialive.UpdateChannelOutput, error)
UpdateChannelRequest(*medialive.UpdateChannelInput) (*request.Request, *medialive.UpdateChannelOutput)
UpdateChannelClass(*medialive.UpdateChannelClassInput) (*medialive.UpdateChannelClassOutput, error)
UpdateChannelClassWithContext(aws.Context, *medialive.UpdateChannelClassInput, ...request.Option) (*medialive.UpdateChannelClassOutput, error)
UpdateChannelClassRequest(*medialive.UpdateChannelClassInput) (*request.Request, *medialive.UpdateChannelClassOutput)
UpdateInput(*medialive.UpdateInputInput) (*medialive.UpdateInputOutput, error)
UpdateInputWithContext(aws.Context, *medialive.UpdateInputInput, ...request.Option) (*medialive.UpdateInputOutput, error)
UpdateInputRequest(*medialive.UpdateInputInput) (*request.Request, *medialive.UpdateInputOutput)
@@ -136,6 +197,22 @@ type MediaLiveAPI interface {
UpdateInputSecurityGroup(*medialive.UpdateInputSecurityGroupInput) (*medialive.UpdateInputSecurityGroupOutput, error)
UpdateInputSecurityGroupWithContext(aws.Context, *medialive.UpdateInputSecurityGroupInput, ...request.Option) (*medialive.UpdateInputSecurityGroupOutput, error)
UpdateInputSecurityGroupRequest(*medialive.UpdateInputSecurityGroupInput) (*request.Request, *medialive.UpdateInputSecurityGroupOutput)
UpdateReservation(*medialive.UpdateReservationInput) (*medialive.UpdateReservationOutput, error)
UpdateReservationWithContext(aws.Context, *medialive.UpdateReservationInput, ...request.Option) (*medialive.UpdateReservationOutput, error)
UpdateReservationRequest(*medialive.UpdateReservationInput) (*request.Request, *medialive.UpdateReservationOutput)
WaitUntilChannelCreated(*medialive.DescribeChannelInput) error
WaitUntilChannelCreatedWithContext(aws.Context, *medialive.DescribeChannelInput, ...request.WaiterOption) error
WaitUntilChannelDeleted(*medialive.DescribeChannelInput) error
WaitUntilChannelDeletedWithContext(aws.Context, *medialive.DescribeChannelInput, ...request.WaiterOption) error
WaitUntilChannelRunning(*medialive.DescribeChannelInput) error
WaitUntilChannelRunningWithContext(aws.Context, *medialive.DescribeChannelInput, ...request.WaiterOption) error
WaitUntilChannelStopped(*medialive.DescribeChannelInput) error
WaitUntilChannelStoppedWithContext(aws.Context, *medialive.DescribeChannelInput, ...request.WaiterOption) error
}
var _ MediaLiveAPI = (*medialive.MediaLive)(nil)
+4 -3
View File
@@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "medialive" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "medialive" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "MediaLive" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the MediaLive client with a session.
@@ -58,11 +59,11 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2017-10-14",
JSONVersion: "1.1",
},
handlers,
),
+239
View File
@@ -0,0 +1,239 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package medialive
import (
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
)
// WaitUntilChannelCreated uses the MediaLive API operation
// DescribeChannel to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *MediaLive) WaitUntilChannelCreated(input *DescribeChannelInput) error {
return c.WaitUntilChannelCreatedWithContext(aws.BackgroundContext(), input)
}
// WaitUntilChannelCreatedWithContext is an extended version of WaitUntilChannelCreated.
// With the support for passing in a context and options to configure the
// Waiter and the underlying request options.
//
// 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 *MediaLive) WaitUntilChannelCreatedWithContext(ctx aws.Context, input *DescribeChannelInput, opts ...request.WaiterOption) error {
w := request.Waiter{
Name: "WaitUntilChannelCreated",
MaxAttempts: 5,
Delay: request.ConstantWaiterDelay(3 * time.Second),
Acceptors: []request.WaiterAcceptor{
{
State: request.SuccessWaiterState,
Matcher: request.PathWaiterMatch, Argument: "State",
Expected: "IDLE",
},
{
State: request.RetryWaiterState,
Matcher: request.PathWaiterMatch, Argument: "State",
Expected: "CREATING",
},
{
State: request.RetryWaiterState,
Matcher: request.StatusWaiterMatch,
Expected: 500,
},
{
State: request.FailureWaiterState,
Matcher: request.PathWaiterMatch, Argument: "State",
Expected: "CREATE_FAILED",
},
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
var inCpy *DescribeChannelInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeChannelRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx)
}
// WaitUntilChannelDeleted uses the MediaLive API operation
// DescribeChannel to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *MediaLive) WaitUntilChannelDeleted(input *DescribeChannelInput) error {
return c.WaitUntilChannelDeletedWithContext(aws.BackgroundContext(), input)
}
// WaitUntilChannelDeletedWithContext is an extended version of WaitUntilChannelDeleted.
// With the support for passing in a context and options to configure the
// Waiter and the underlying request options.
//
// 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 *MediaLive) WaitUntilChannelDeletedWithContext(ctx aws.Context, input *DescribeChannelInput, opts ...request.WaiterOption) error {
w := request.Waiter{
Name: "WaitUntilChannelDeleted",
MaxAttempts: 20,
Delay: request.ConstantWaiterDelay(5 * time.Second),
Acceptors: []request.WaiterAcceptor{
{
State: request.SuccessWaiterState,
Matcher: request.PathWaiterMatch, Argument: "State",
Expected: "DELETED",
},
{
State: request.RetryWaiterState,
Matcher: request.PathWaiterMatch, Argument: "State",
Expected: "DELETING",
},
{
State: request.RetryWaiterState,
Matcher: request.StatusWaiterMatch,
Expected: 500,
},
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
var inCpy *DescribeChannelInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeChannelRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx)
}
// WaitUntilChannelRunning uses the MediaLive API operation
// DescribeChannel to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *MediaLive) WaitUntilChannelRunning(input *DescribeChannelInput) error {
return c.WaitUntilChannelRunningWithContext(aws.BackgroundContext(), input)
}
// WaitUntilChannelRunningWithContext is an extended version of WaitUntilChannelRunning.
// With the support for passing in a context and options to configure the
// Waiter and the underlying request options.
//
// 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 *MediaLive) WaitUntilChannelRunningWithContext(ctx aws.Context, input *DescribeChannelInput, opts ...request.WaiterOption) error {
w := request.Waiter{
Name: "WaitUntilChannelRunning",
MaxAttempts: 120,
Delay: request.ConstantWaiterDelay(5 * time.Second),
Acceptors: []request.WaiterAcceptor{
{
State: request.SuccessWaiterState,
Matcher: request.PathWaiterMatch, Argument: "State",
Expected: "RUNNING",
},
{
State: request.RetryWaiterState,
Matcher: request.PathWaiterMatch, Argument: "State",
Expected: "STARTING",
},
{
State: request.RetryWaiterState,
Matcher: request.StatusWaiterMatch,
Expected: 500,
},
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
var inCpy *DescribeChannelInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeChannelRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx)
}
// WaitUntilChannelStopped uses the MediaLive API operation
// DescribeChannel to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *MediaLive) WaitUntilChannelStopped(input *DescribeChannelInput) error {
return c.WaitUntilChannelStoppedWithContext(aws.BackgroundContext(), input)
}
// WaitUntilChannelStoppedWithContext is an extended version of WaitUntilChannelStopped.
// With the support for passing in a context and options to configure the
// Waiter and the underlying request options.
//
// 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 *MediaLive) WaitUntilChannelStoppedWithContext(ctx aws.Context, input *DescribeChannelInput, opts ...request.WaiterOption) error {
w := request.Waiter{
Name: "WaitUntilChannelStopped",
MaxAttempts: 28,
Delay: request.ConstantWaiterDelay(5 * time.Second),
Acceptors: []request.WaiterAcceptor{
{
State: request.SuccessWaiterState,
Matcher: request.PathWaiterMatch, Argument: "State",
Expected: "IDLE",
},
{
State: request.RetryWaiterState,
Matcher: request.PathWaiterMatch, Argument: "State",
Expected: "STOPPING",
},
{
State: request.RetryWaiterState,
Matcher: request.StatusWaiterMatch,
Expected: 500,
},
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
var inCpy *DescribeChannelInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeChannelRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx)
}