Update vendored deps, including AWS SDK, openpgp, ftp, ...

This commit is contained in:
Andrey Smirnov
2018-04-05 17:46:45 +03:00
parent cef4fefc40
commit 0e6ee35942
1497 changed files with 450721 additions and 68034 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ func Build(r *request.Request) {
r.Error = awserr.New("SerializationError", "failed encoding EC2 Query request", err)
}
if r.ExpireTime == 0 {
if !r.IsPresigned() {
r.HTTPRequest.Method = "POST"
r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8")
r.SetBufferBody([]byte(body.Encode()))
+408 -37
View File
@@ -24,7 +24,6 @@ import (
"github.com/aws/aws-sdk-go/private/protocol/ec2query"
"github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil"
"github.com/aws/aws-sdk-go/private/util"
"github.com/stretchr/testify/assert"
)
var _ bytes.Buffer // always import bytes
@@ -108,7 +107,7 @@ const opInputService1TestCaseOperation1 = "OperationName"
// InputService1TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the InputService1TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -261,7 +260,7 @@ const opInputService2TestCaseOperation1 = "OperationName"
// InputService2TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the InputService2TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -422,7 +421,7 @@ const opInputService3TestCaseOperation1 = "OperationName"
// InputService3TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the InputService3TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -579,7 +578,7 @@ const opInputService4TestCaseOperation1 = "OperationName"
// InputService4TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the InputService4TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -648,12 +647,36 @@ func (c *InputService4ProtocolTest) InputService4TestCaseOperation1WithContext(c
type InputService4TestShapeInputService4TestCaseOperation1Input struct {
_ struct{} `type:"structure"`
ListArg []*string `type:"list"`
ListBools []*bool `type:"list"`
ListFloats []*float64 `type:"list"`
ListIntegers []*int64 `type:"list"`
ListStrings []*string `type:"list"`
}
// SetListArg sets the ListArg field's value.
func (s *InputService4TestShapeInputService4TestCaseOperation1Input) SetListArg(v []*string) *InputService4TestShapeInputService4TestCaseOperation1Input {
s.ListArg = v
// SetListBools sets the ListBools field's value.
func (s *InputService4TestShapeInputService4TestCaseOperation1Input) SetListBools(v []*bool) *InputService4TestShapeInputService4TestCaseOperation1Input {
s.ListBools = v
return s
}
// SetListFloats sets the ListFloats field's value.
func (s *InputService4TestShapeInputService4TestCaseOperation1Input) SetListFloats(v []*float64) *InputService4TestShapeInputService4TestCaseOperation1Input {
s.ListFloats = v
return s
}
// SetListIntegers sets the ListIntegers field's value.
func (s *InputService4TestShapeInputService4TestCaseOperation1Input) SetListIntegers(v []*int64) *InputService4TestShapeInputService4TestCaseOperation1Input {
s.ListIntegers = v
return s
}
// SetListStrings sets the ListStrings field's value.
func (s *InputService4TestShapeInputService4TestCaseOperation1Input) SetListStrings(v []*string) *InputService4TestShapeInputService4TestCaseOperation1Input {
s.ListStrings = v
return s
}
@@ -724,7 +747,7 @@ const opInputService5TestCaseOperation1 = "OperationName"
// InputService5TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the InputService5TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -869,7 +892,7 @@ const opInputService6TestCaseOperation1 = "OperationName"
// InputService6TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the InputService6TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -1014,7 +1037,7 @@ const opInputService7TestCaseOperation1 = "OperationName"
// InputService7TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the InputService7TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -1160,7 +1183,7 @@ const opInputService8TestCaseOperation1 = "OperationName"
// InputService8TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the InputService8TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -1305,7 +1328,7 @@ const opInputService9TestCaseOperation1 = "OperationName"
// InputService9TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the InputService9TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -1375,7 +1398,7 @@ const opInputService9TestCaseOperation2 = "OperationName"
// InputService9TestCaseOperation2Request generates a "aws/request.Request" representing the
// client's request for the InputService9TestCaseOperation2 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -1461,6 +1484,241 @@ type InputService9TestShapeInputService9TestCaseOperation2Output struct {
_ struct{} `type:"structure"`
}
// InputService10ProtocolTest provides the API operation methods for making requests to
// . See this package's package overview docs
// for details on the service.
//
// InputService10ProtocolTest methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type InputService10ProtocolTest struct {
*client.Client
}
// New creates a new instance of the InputService10ProtocolTest client with a session.
// If additional configuration is needed for the client instance use the optional
// aws.Config parameter to add your extra config.
//
// Example:
// // Create a InputService10ProtocolTest client from just a session.
// svc := inputservice10protocoltest.New(mySession)
//
// // Create a InputService10ProtocolTest client with additional configuration
// svc := inputservice10protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func NewInputService10ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService10ProtocolTest {
c := p.ClientConfig("inputservice10protocoltest", cfgs...)
return newInputService10ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
}
// newClient creates, initializes and returns a new service client instance.
func newInputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService10ProtocolTest {
svc := &InputService10ProtocolTest{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: "inputservice10protocoltest",
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2014-01-01",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(ec2query.UnmarshalErrorHandler)
return svc
}
// newRequest creates a new request for a InputService10ProtocolTest operation and runs any
// custom request initialization.
func (c *InputService10ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
req := c.NewRequest(op, params, data)
return req
}
const opInputService10TestCaseOperation1 = "OperationName"
// InputService10TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the InputService10TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// 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.
//
// See InputService10TestCaseOperation1 for more information on using the InputService10TestCaseOperation1
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the InputService10TestCaseOperation1Request method.
// req, resp := client.InputService10TestCaseOperation1Request(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *InputService10ProtocolTest) InputService10TestCaseOperation1Request(input *InputService10TestShapeInputService10TestCaseOperation2Input) (req *request.Request, output *InputService10TestShapeInputService10TestCaseOperation1Output) {
op := &request.Operation{
Name: opInputService10TestCaseOperation1,
HTTPPath: "/",
}
if input == nil {
input = &InputService10TestShapeInputService10TestCaseOperation2Input{}
}
output = &InputService10TestShapeInputService10TestCaseOperation1Output{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// InputService10TestCaseOperation1 API operation for .
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for 's
// API operation InputService10TestCaseOperation1 for usage and error information.
func (c *InputService10ProtocolTest) InputService10TestCaseOperation1(input *InputService10TestShapeInputService10TestCaseOperation2Input) (*InputService10TestShapeInputService10TestCaseOperation1Output, error) {
req, out := c.InputService10TestCaseOperation1Request(input)
return out, req.Send()
}
// InputService10TestCaseOperation1WithContext is the same as InputService10TestCaseOperation1 with the addition of
// the ability to pass a context and additional request options.
//
// See InputService10TestCaseOperation1 for details on how to use this API operation.
//
// 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 *InputService10ProtocolTest) InputService10TestCaseOperation1WithContext(ctx aws.Context, input *InputService10TestShapeInputService10TestCaseOperation2Input, opts ...request.Option) (*InputService10TestShapeInputService10TestCaseOperation1Output, error) {
req, out := c.InputService10TestCaseOperation1Request(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opInputService10TestCaseOperation2 = "OperationName"
// InputService10TestCaseOperation2Request generates a "aws/request.Request" representing the
// client's request for the InputService10TestCaseOperation2 operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// 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.
//
// See InputService10TestCaseOperation2 for more information on using the InputService10TestCaseOperation2
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the InputService10TestCaseOperation2Request method.
// req, resp := client.InputService10TestCaseOperation2Request(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *InputService10ProtocolTest) InputService10TestCaseOperation2Request(input *InputService10TestShapeInputService10TestCaseOperation2Input) (req *request.Request, output *InputService10TestShapeInputService10TestCaseOperation2Output) {
op := &request.Operation{
Name: opInputService10TestCaseOperation2,
HTTPPath: "/",
}
if input == nil {
input = &InputService10TestShapeInputService10TestCaseOperation2Input{}
}
output = &InputService10TestShapeInputService10TestCaseOperation2Output{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// InputService10TestCaseOperation2 API operation for .
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for 's
// API operation InputService10TestCaseOperation2 for usage and error information.
func (c *InputService10ProtocolTest) InputService10TestCaseOperation2(input *InputService10TestShapeInputService10TestCaseOperation2Input) (*InputService10TestShapeInputService10TestCaseOperation2Output, error) {
req, out := c.InputService10TestCaseOperation2Request(input)
return out, req.Send()
}
// InputService10TestCaseOperation2WithContext is the same as InputService10TestCaseOperation2 with the addition of
// the ability to pass a context and additional request options.
//
// See InputService10TestCaseOperation2 for details on how to use this API operation.
//
// 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 *InputService10ProtocolTest) InputService10TestCaseOperation2WithContext(ctx aws.Context, input *InputService10TestShapeInputService10TestCaseOperation2Input, opts ...request.Option) (*InputService10TestShapeInputService10TestCaseOperation2Output, error) {
req, out := c.InputService10TestCaseOperation2Request(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
type InputService10TestShapeInputService10TestCaseOperation1Output struct {
_ struct{} `type:"structure"`
}
type InputService10TestShapeInputService10TestCaseOperation2Input struct {
_ struct{} `type:"structure"`
FooEnum *string `type:"string" enum:"InputService10TestShapeEnumType"`
ListEnums []*string `type:"list"`
}
// SetFooEnum sets the FooEnum field's value.
func (s *InputService10TestShapeInputService10TestCaseOperation2Input) SetFooEnum(v string) *InputService10TestShapeInputService10TestCaseOperation2Input {
s.FooEnum = &v
return s
}
// SetListEnums sets the ListEnums field's value.
func (s *InputService10TestShapeInputService10TestCaseOperation2Input) SetListEnums(v []*string) *InputService10TestShapeInputService10TestCaseOperation2Input {
s.ListEnums = v
return s
}
type InputService10TestShapeInputService10TestCaseOperation2Output struct {
_ struct{} `type:"structure"`
}
const (
// EnumTypeFoo is a InputService10TestShapeEnumType enum value
EnumTypeFoo = "foo"
// EnumTypeBar is a InputService10TestShapeEnumType enum value
EnumTypeBar = "bar"
)
//
// Tests begin here
//
@@ -1476,10 +1734,14 @@ func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) {
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect no error, got %v", req.Error)
}
// assert body
assert.NotNil(t, r.Body)
if r.Body == nil {
t.Errorf("expect body not to be nil")
}
body, _ := ioutil.ReadAll(r.Body)
awstesting.AssertQuery(t, `Action=OperationName&Bar=val2&Foo=val1&Version=2014-01-01`, util.Trim(string(body)))
@@ -1502,10 +1764,14 @@ func TestInputService2ProtocolTestStructureWithLocationNameAndQueryNameAppliedTo
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect no error, got %v", req.Error)
}
// assert body
assert.NotNil(t, r.Body)
if r.Body == nil {
t.Errorf("expect body not to be nil")
}
body, _ := ioutil.ReadAll(r.Body)
awstesting.AssertQuery(t, `Action=OperationName&BarLocationName=val2&Foo=val1&Version=2014-01-01&yuckQueryName=val3`, util.Trim(string(body)))
@@ -1528,10 +1794,14 @@ func TestInputService3ProtocolTestNestedStructureMembersCase1(t *testing.T) {
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect no error, got %v", req.Error)
}
// assert body
assert.NotNil(t, r.Body)
if r.Body == nil {
t.Errorf("expect body not to be nil")
}
body, _ := ioutil.ReadAll(r.Body)
awstesting.AssertQuery(t, `Action=OperationName&Struct.Scalar=foo&Version=2014-01-01`, util.Trim(string(body)))
@@ -1545,7 +1815,22 @@ func TestInputService3ProtocolTestNestedStructureMembersCase1(t *testing.T) {
func TestInputService4ProtocolTestListTypesCase1(t *testing.T) {
svc := NewInputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
input := &InputService4TestShapeInputService4TestCaseOperation1Input{
ListArg: []*string{
ListBools: []*bool{
aws.Bool(true),
aws.Bool(false),
aws.Bool(false),
},
ListFloats: []*float64{
aws.Float64(1.1),
aws.Float64(2.718),
aws.Float64(3.14),
},
ListIntegers: []*int64{
aws.Int64(0),
aws.Int64(1),
aws.Int64(2),
},
ListStrings: []*string{
aws.String("foo"),
aws.String("bar"),
aws.String("baz"),
@@ -1556,12 +1841,16 @@ func TestInputService4ProtocolTestListTypesCase1(t *testing.T) {
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect no error, got %v", req.Error)
}
// assert body
assert.NotNil(t, r.Body)
if r.Body == nil {
t.Errorf("expect body not to be nil")
}
body, _ := ioutil.ReadAll(r.Body)
awstesting.AssertQuery(t, `Action=OperationName&ListArg.1=foo&ListArg.2=bar&ListArg.3=baz&Version=2014-01-01`, util.Trim(string(body)))
awstesting.AssertQuery(t, `Action=OperationName&ListBools.1=true&ListBools.2=false&ListBools.3=false&ListFloats.1=1.1&ListFloats.2=2.718&ListFloats.3=3.14&ListIntegers.1=0&ListIntegers.2=1&ListIntegers.3=2&ListStrings.1=foo&ListStrings.2=bar&ListStrings.3=baz&Version=2014-01-01`, util.Trim(string(body)))
// assert URL
awstesting.AssertURL(t, "https://test/", r.URL.String())
@@ -1584,10 +1873,14 @@ func TestInputService5ProtocolTestListWithLocationNameAppliedToMemberCase1(t *te
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect no error, got %v", req.Error)
}
// assert body
assert.NotNil(t, r.Body)
if r.Body == nil {
t.Errorf("expect body not to be nil")
}
body, _ := ioutil.ReadAll(r.Body)
awstesting.AssertQuery(t, `Action=OperationName&ListMemberName.1=a&ListMemberName.2=b&ListMemberName.3=c&Version=2014-01-01`, util.Trim(string(body)))
@@ -1612,10 +1905,14 @@ func TestInputService6ProtocolTestListWithLocationNameAndQueryNameCase1(t *testi
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect no error, got %v", req.Error)
}
// assert body
assert.NotNil(t, r.Body)
if r.Body == nil {
t.Errorf("expect body not to be nil")
}
body, _ := ioutil.ReadAll(r.Body)
awstesting.AssertQuery(t, `Action=OperationName&ListQueryName.1=a&ListQueryName.2=b&ListQueryName.3=c&Version=2014-01-01`, util.Trim(string(body)))
@@ -1636,10 +1933,14 @@ func TestInputService7ProtocolTestBase64EncodedBlobsCase1(t *testing.T) {
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect no error, got %v", req.Error)
}
// assert body
assert.NotNil(t, r.Body)
if r.Body == nil {
t.Errorf("expect body not to be nil")
}
body, _ := ioutil.ReadAll(r.Body)
awstesting.AssertQuery(t, `Action=OperationName&BlobArg=Zm9v&Version=2014-01-01`, util.Trim(string(body)))
@@ -1660,10 +1961,14 @@ func TestInputService8ProtocolTestTimestampValuesCase1(t *testing.T) {
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect no error, got %v", req.Error)
}
// assert body
assert.NotNil(t, r.Body)
if r.Body == nil {
t.Errorf("expect body not to be nil")
}
body, _ := ioutil.ReadAll(r.Body)
awstesting.AssertQuery(t, `Action=OperationName&TimeArg=2015-01-25T08%3A00%3A00Z&Version=2014-01-01`, util.Trim(string(body)))
@@ -1684,10 +1989,14 @@ func TestInputService9ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) {
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect no error, got %v", req.Error)
}
// assert body
assert.NotNil(t, r.Body)
if r.Body == nil {
t.Errorf("expect body not to be nil")
}
body, _ := ioutil.ReadAll(r.Body)
awstesting.AssertQuery(t, `Action=OperationName&Token=abc123&Version=2014-01-01`, util.Trim(string(body)))
@@ -1706,10 +2015,14 @@ func TestInputService9ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) {
// build request
ec2query.Build(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect no error, got %v", req.Error)
}
// assert body
assert.NotNil(t, r.Body)
if r.Body == nil {
t.Errorf("expect body not to be nil")
}
body, _ := ioutil.ReadAll(r.Body)
awstesting.AssertQuery(t, `Action=OperationName&Token=00000000-0000-4000-8000-000000000000&Version=2014-01-01`, util.Trim(string(body)))
@@ -1719,3 +2032,61 @@ func TestInputService9ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) {
// assert headers
}
func TestInputService10ProtocolTestEnumCase1(t *testing.T) {
svc := NewInputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
input := &InputService10TestShapeInputService10TestCaseOperation2Input{
ListEnums: []*string{
aws.String("foo"),
aws.String(""),
aws.String("bar"),
},
}
req, _ := svc.InputService10TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
ec2query.Build(req)
if req.Error != nil {
t.Errorf("expect no error, got %v", req.Error)
}
// assert body
if r.Body == nil {
t.Errorf("expect body not to be nil")
}
body, _ := ioutil.ReadAll(r.Body)
awstesting.AssertQuery(t, `Action=OperationName&ListEnums.1=foo&ListEnums.2=&ListEnums.3=bar&Version=2014-01-01`, util.Trim(string(body)))
// assert URL
awstesting.AssertURL(t, "https://test/", r.URL.String())
// assert headers
}
func TestInputService10ProtocolTestEnumCase2(t *testing.T) {
svc := NewInputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
input := &InputService10TestShapeInputService10TestCaseOperation2Input{}
req, _ := svc.InputService10TestCaseOperation2Request(input)
r := req.HTTPRequest
// build request
ec2query.Build(req)
if req.Error != nil {
t.Errorf("expect no error, got %v", req.Error)
}
// assert body
if r.Body == nil {
t.Errorf("expect body not to be nil")
}
body, _ := ioutil.ReadAll(r.Body)
awstesting.AssertQuery(t, `Action=OperationName&Version=2014-01-01`, util.Trim(string(body)))
// assert URL
awstesting.AssertURL(t, "https://test/", r.URL.String())
// assert headers
}
+320 -50
View File
@@ -24,7 +24,6 @@ import (
"github.com/aws/aws-sdk-go/private/protocol/ec2query"
"github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil"
"github.com/aws/aws-sdk-go/private/util"
"github.com/stretchr/testify/assert"
)
var _ bytes.Buffer // always import bytes
@@ -108,7 +107,7 @@ const opOutputService1TestCaseOperation1 = "OperationName"
// OutputService1TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the OutputService1TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -307,7 +306,7 @@ const opOutputService2TestCaseOperation1 = "OperationName"
// OutputService2TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the OutputService2TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -451,7 +450,7 @@ const opOutputService3TestCaseOperation1 = "OperationName"
// OutputService3TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the OutputService3TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -594,7 +593,7 @@ const opOutputService4TestCaseOperation1 = "OperationName"
// OutputService4TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the OutputService4TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -737,7 +736,7 @@ const opOutputService5TestCaseOperation1 = "OperationName"
// OutputService5TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the OutputService5TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -880,7 +879,7 @@ const opOutputService6TestCaseOperation1 = "OperationName"
// OutputService6TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the OutputService6TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -1035,7 +1034,7 @@ const opOutputService7TestCaseOperation1 = "OperationName"
// OutputService7TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the OutputService7TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -1178,7 +1177,7 @@ const opOutputService8TestCaseOperation1 = "OperationName"
// OutputService8TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the OutputService8TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -1321,7 +1320,7 @@ const opOutputService9TestCaseOperation1 = "OperationName"
// OutputService9TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the OutputService9TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
@@ -1401,6 +1400,165 @@ func (s *OutputService9TestShapeOutputService9TestCaseOperation1Output) SetFoo(v
return s
}
// OutputService10ProtocolTest provides the API operation methods for making requests to
// . See this package's package overview docs
// for details on the service.
//
// OutputService10ProtocolTest methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type OutputService10ProtocolTest struct {
*client.Client
}
// New creates a new instance of the OutputService10ProtocolTest client with a session.
// If additional configuration is needed for the client instance use the optional
// aws.Config parameter to add your extra config.
//
// Example:
// // Create a OutputService10ProtocolTest client from just a session.
// svc := outputservice10protocoltest.New(mySession)
//
// // Create a OutputService10ProtocolTest client with additional configuration
// svc := outputservice10protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func NewOutputService10ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService10ProtocolTest {
c := p.ClientConfig("outputservice10protocoltest", cfgs...)
return newOutputService10ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
}
// newClient creates, initializes and returns a new service client instance.
func newOutputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService10ProtocolTest {
svc := &OutputService10ProtocolTest{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: "outputservice10protocoltest",
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(ec2query.UnmarshalErrorHandler)
return svc
}
// newRequest creates a new request for a OutputService10ProtocolTest operation and runs any
// custom request initialization.
func (c *OutputService10ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
req := c.NewRequest(op, params, data)
return req
}
const opOutputService10TestCaseOperation1 = "OperationName"
// OutputService10TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the OutputService10TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// 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.
//
// See OutputService10TestCaseOperation1 for more information on using the OutputService10TestCaseOperation1
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the OutputService10TestCaseOperation1Request method.
// req, resp := client.OutputService10TestCaseOperation1Request(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1Request(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (req *request.Request, output *OutputService10TestShapeOutputService10TestCaseOperation1Output) {
op := &request.Operation{
Name: opOutputService10TestCaseOperation1,
HTTPPath: "/",
}
if input == nil {
input = &OutputService10TestShapeOutputService10TestCaseOperation1Input{}
}
output = &OutputService10TestShapeOutputService10TestCaseOperation1Output{}
req = c.newRequest(op, input, output)
return
}
// OutputService10TestCaseOperation1 API operation for .
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for 's
// API operation OutputService10TestCaseOperation1 for usage and error information.
func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (*OutputService10TestShapeOutputService10TestCaseOperation1Output, error) {
req, out := c.OutputService10TestCaseOperation1Request(input)
return out, req.Send()
}
// OutputService10TestCaseOperation1WithContext is the same as OutputService10TestCaseOperation1 with the addition of
// the ability to pass a context and additional request options.
//
// See OutputService10TestCaseOperation1 for details on how to use this API operation.
//
// 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 *OutputService10ProtocolTest) OutputService10TestCaseOperation1WithContext(ctx aws.Context, input *OutputService10TestShapeOutputService10TestCaseOperation1Input, opts ...request.Option) (*OutputService10TestShapeOutputService10TestCaseOperation1Output, error) {
req, out := c.OutputService10TestCaseOperation1Request(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
type OutputService10TestShapeOutputService10TestCaseOperation1Input struct {
_ struct{} `type:"structure"`
}
type OutputService10TestShapeOutputService10TestCaseOperation1Output struct {
_ struct{} `type:"structure"`
FooEnum *string `type:"string" enum:"OutputService10TestShapeEC2EnumType"`
ListEnums []*string `type:"list"`
}
// SetFooEnum sets the FooEnum field's value.
func (s *OutputService10TestShapeOutputService10TestCaseOperation1Output) SetFooEnum(v string) *OutputService10TestShapeOutputService10TestCaseOperation1Output {
s.FooEnum = &v
return s
}
// SetListEnums sets the ListEnums field's value.
func (s *OutputService10TestShapeOutputService10TestCaseOperation1Output) SetListEnums(v []*string) *OutputService10TestShapeOutputService10TestCaseOperation1Output {
s.ListEnums = v
return s
}
const (
// EC2EnumTypeFoo is a OutputService10TestShapeEC2EnumType enum value
EC2EnumTypeFoo = "foo"
// EC2EnumTypeBar is a OutputService10TestShapeEC2EnumType enum value
EC2EnumTypeBar = "bar"
)
//
// Tests begin here
//
@@ -1417,18 +1575,38 @@ func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) {
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect not error, got %v", req.Error)
}
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "a", *out.Char)
assert.Equal(t, 1.3, *out.Double)
assert.Equal(t, false, *out.FalseBool)
assert.Equal(t, 1.2, *out.Float)
assert.Equal(t, int64(200), *out.Long)
assert.Equal(t, int64(123), *out.Num)
assert.Equal(t, "myname", *out.Str)
assert.Equal(t, true, *out.TrueBool)
if out == nil {
t.Errorf("expect not to be nil")
}
if e, a := "a", *out.Char; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := 1.3, *out.Double; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := false, *out.FalseBool; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := 1.2, *out.Float; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := int64(200), *out.Long; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := int64(123), *out.Num; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "myname", *out.Str; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := true, *out.TrueBool; e != a {
t.Errorf("expect %v, got %v", e, a)
}
}
@@ -1444,11 +1622,17 @@ func TestOutputService2ProtocolTestBlobCase1(t *testing.T) {
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect not error, got %v", req.Error)
}
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "value", string(out.Blob))
if out == nil {
t.Errorf("expect not to be nil")
}
if e, a := "value", string(out.Blob); e != a {
t.Errorf("expect %v, got %v", e, a)
}
}
@@ -1464,12 +1648,20 @@ func TestOutputService3ProtocolTestListsCase1(t *testing.T) {
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect not error, got %v", req.Error)
}
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "abc", *out.ListMember[0])
assert.Equal(t, "123", *out.ListMember[1])
if out == nil {
t.Errorf("expect not to be nil")
}
if e, a := "abc", *out.ListMember[0]; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "123", *out.ListMember[1]; e != a {
t.Errorf("expect %v, got %v", e, a)
}
}
@@ -1485,12 +1677,20 @@ func TestOutputService4ProtocolTestListWithCustomMemberNameCase1(t *testing.T) {
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect not error, got %v", req.Error)
}
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "abc", *out.ListMember[0])
assert.Equal(t, "123", *out.ListMember[1])
if out == nil {
t.Errorf("expect not to be nil")
}
if e, a := "abc", *out.ListMember[0]; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "123", *out.ListMember[1]; e != a {
t.Errorf("expect %v, got %v", e, a)
}
}
@@ -1506,12 +1706,20 @@ func TestOutputService5ProtocolTestFlattenedListCase1(t *testing.T) {
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect not error, got %v", req.Error)
}
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "abc", *out.ListMember[0])
assert.Equal(t, "123", *out.ListMember[1])
if out == nil {
t.Errorf("expect not to be nil")
}
if e, a := "abc", *out.ListMember[0]; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "123", *out.ListMember[1]; e != a {
t.Errorf("expect %v, got %v", e, a)
}
}
@@ -1527,12 +1735,20 @@ func TestOutputService6ProtocolTestNormalMapCase1(t *testing.T) {
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect not error, got %v", req.Error)
}
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "bam", *out.Map["baz"].Foo)
assert.Equal(t, "bar", *out.Map["qux"].Foo)
if out == nil {
t.Errorf("expect not to be nil")
}
if e, a := "bam", *out.Map["baz"].Foo; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "bar", *out.Map["qux"].Foo; e != a {
t.Errorf("expect %v, got %v", e, a)
}
}
@@ -1548,12 +1764,20 @@ func TestOutputService7ProtocolTestFlattenedMapCase1(t *testing.T) {
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect not error, got %v", req.Error)
}
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "bam", *out.Map["baz"])
assert.Equal(t, "bar", *out.Map["qux"])
if out == nil {
t.Errorf("expect not to be nil")
}
if e, a := "bam", *out.Map["baz"]; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "bar", *out.Map["qux"]; e != a {
t.Errorf("expect %v, got %v", e, a)
}
}
@@ -1569,12 +1793,20 @@ func TestOutputService8ProtocolTestNamedMapCase1(t *testing.T) {
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect not error, got %v", req.Error)
}
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "bam", *out.Map["baz"])
assert.Equal(t, "bar", *out.Map["qux"])
if out == nil {
t.Errorf("expect not to be nil")
}
if e, a := "bam", *out.Map["baz"]; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "bar", *out.Map["qux"]; e != a {
t.Errorf("expect %v, got %v", e, a)
}
}
@@ -1590,10 +1822,48 @@ func TestOutputService9ProtocolTestEmptyStringCase1(t *testing.T) {
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
assert.NoError(t, req.Error)
if req.Error != nil {
t.Errorf("expect not error, got %v", req.Error)
}
// assert response
assert.NotNil(t, out) // ensure out variable is used
assert.Equal(t, "", *out.Foo)
if out == nil {
t.Errorf("expect not to be nil")
}
if e, a := "", *out.Foo; e != a {
t.Errorf("expect %v, got %v", e, a)
}
}
func TestOutputService10ProtocolTestEnumOutputCase1(t *testing.T) {
svc := NewOutputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("<OperationNameResponse><FooEnum>foo</FooEnum><ListEnums><member>foo</member><member>bar</member></ListEnums></OperationNameResponse>"))
req, out := svc.OutputService10TestCaseOperation1Request(nil)
req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
// set headers
// unmarshal response
ec2query.UnmarshalMeta(req)
ec2query.Unmarshal(req)
if req.Error != nil {
t.Errorf("expect not error, got %v", req.Error)
}
// assert response
if out == nil {
t.Errorf("expect not to be nil")
}
if e, a := "foo", *out.FooEnum; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "foo", *out.ListEnums[0]; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "bar", *out.ListEnums[1]; e != a {
t.Errorf("expect %v, got %v", e, a)
}
}