1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-29 06:33:16 +00:00

vendor: update all dependencies to latest versions

This commit is contained in:
Nick Craig-Wood
2018-01-16 13:20:59 +00:00
parent 8e83fb6fb9
commit 7d3a17725d
4878 changed files with 1974229 additions and 201215 deletions

View File

@@ -4902,6 +4902,273 @@ type InputService24TestShapeInputService24TestCaseOperation2Output struct {
_ struct{} `type:"structure"`
}
// InputService25ProtocolTest provides the API operation methods for making requests to
// . See this package's package overview docs
// for details on the service.
//
// InputService25ProtocolTest methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type InputService25ProtocolTest struct {
*client.Client
}
// New creates a new instance of the InputService25ProtocolTest 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 InputService25ProtocolTest client from just a session.
// svc := inputservice25protocoltest.New(mySession)
//
// // Create a InputService25ProtocolTest client with additional configuration
// svc := inputservice25protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func NewInputService25ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService25ProtocolTest {
c := p.ClientConfig("inputservice25protocoltest", cfgs...)
return newInputService25ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
}
// newClient creates, initializes and returns a new service client instance.
func newInputService25ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService25ProtocolTest {
svc := &InputService25ProtocolTest{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: "inputservice25protocoltest",
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2014-01-01",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
return svc
}
// newRequest creates a new request for a InputService25ProtocolTest operation and runs any
// custom request initialization.
func (c *InputService25ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
req := c.NewRequest(op, params, data)
return req
}
const opInputService25TestCaseOperation1 = "OperationName"
// InputService25TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the InputService25TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// 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 InputService25TestCaseOperation1 for more information on using the InputService25TestCaseOperation1
// 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 InputService25TestCaseOperation1Request method.
// req, resp := client.InputService25TestCaseOperation1Request(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *InputService25ProtocolTest) InputService25TestCaseOperation1Request(input *InputService25TestShapeInputService25TestCaseOperation2Input) (req *request.Request, output *InputService25TestShapeInputService25TestCaseOperation1Output) {
op := &request.Operation{
Name: opInputService25TestCaseOperation1,
HTTPMethod: "POST",
HTTPPath: "/Enum/{URIEnum}",
}
if input == nil {
input = &InputService25TestShapeInputService25TestCaseOperation2Input{}
}
output = &InputService25TestShapeInputService25TestCaseOperation1Output{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// InputService25TestCaseOperation1 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 InputService25TestCaseOperation1 for usage and error information.
func (c *InputService25ProtocolTest) InputService25TestCaseOperation1(input *InputService25TestShapeInputService25TestCaseOperation2Input) (*InputService25TestShapeInputService25TestCaseOperation1Output, error) {
req, out := c.InputService25TestCaseOperation1Request(input)
return out, req.Send()
}
// InputService25TestCaseOperation1WithContext is the same as InputService25TestCaseOperation1 with the addition of
// the ability to pass a context and additional request options.
//
// See InputService25TestCaseOperation1 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 *InputService25ProtocolTest) InputService25TestCaseOperation1WithContext(ctx aws.Context, input *InputService25TestShapeInputService25TestCaseOperation2Input, opts ...request.Option) (*InputService25TestShapeInputService25TestCaseOperation1Output, error) {
req, out := c.InputService25TestCaseOperation1Request(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opInputService25TestCaseOperation2 = "OperationName"
// InputService25TestCaseOperation2Request generates a "aws/request.Request" representing the
// client's request for the InputService25TestCaseOperation2 operation. The "output" return
// value will be populated with the request's response once the request complets
// 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 InputService25TestCaseOperation2 for more information on using the InputService25TestCaseOperation2
// 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 InputService25TestCaseOperation2Request method.
// req, resp := client.InputService25TestCaseOperation2Request(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *InputService25ProtocolTest) InputService25TestCaseOperation2Request(input *InputService25TestShapeInputService25TestCaseOperation2Input) (req *request.Request, output *InputService25TestShapeInputService25TestCaseOperation2Output) {
op := &request.Operation{
Name: opInputService25TestCaseOperation2,
HTTPMethod: "POST",
HTTPPath: "/path",
}
if input == nil {
input = &InputService25TestShapeInputService25TestCaseOperation2Input{}
}
output = &InputService25TestShapeInputService25TestCaseOperation2Output{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// InputService25TestCaseOperation2 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 InputService25TestCaseOperation2 for usage and error information.
func (c *InputService25ProtocolTest) InputService25TestCaseOperation2(input *InputService25TestShapeInputService25TestCaseOperation2Input) (*InputService25TestShapeInputService25TestCaseOperation2Output, error) {
req, out := c.InputService25TestCaseOperation2Request(input)
return out, req.Send()
}
// InputService25TestCaseOperation2WithContext is the same as InputService25TestCaseOperation2 with the addition of
// the ability to pass a context and additional request options.
//
// See InputService25TestCaseOperation2 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 *InputService25ProtocolTest) InputService25TestCaseOperation2WithContext(ctx aws.Context, input *InputService25TestShapeInputService25TestCaseOperation2Input, opts ...request.Option) (*InputService25TestShapeInputService25TestCaseOperation2Output, error) {
req, out := c.InputService25TestCaseOperation2Request(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
type InputService25TestShapeInputService25TestCaseOperation1Output struct {
_ struct{} `type:"structure"`
}
type InputService25TestShapeInputService25TestCaseOperation2Input struct {
_ struct{} `type:"structure"`
FooEnum *string `type:"string" enum:"InputService25TestShapeEnumType"`
HeaderEnum *string `location:"header" locationName:"x-amz-enum" type:"string" enum:"InputService25TestShapeEnumType"`
ListEnums []*string `type:"list"`
URIFooEnum *string `location:"uri" locationName:"URIEnum" type:"string" enum:"InputService25TestShapeEnumType"`
URIListEnums []*string `location:"querystring" locationName:"ListEnums" type:"list"`
}
// SetFooEnum sets the FooEnum field's value.
func (s *InputService25TestShapeInputService25TestCaseOperation2Input) SetFooEnum(v string) *InputService25TestShapeInputService25TestCaseOperation2Input {
s.FooEnum = &v
return s
}
// SetHeaderEnum sets the HeaderEnum field's value.
func (s *InputService25TestShapeInputService25TestCaseOperation2Input) SetHeaderEnum(v string) *InputService25TestShapeInputService25TestCaseOperation2Input {
s.HeaderEnum = &v
return s
}
// SetListEnums sets the ListEnums field's value.
func (s *InputService25TestShapeInputService25TestCaseOperation2Input) SetListEnums(v []*string) *InputService25TestShapeInputService25TestCaseOperation2Input {
s.ListEnums = v
return s
}
// SetURIFooEnum sets the URIFooEnum field's value.
func (s *InputService25TestShapeInputService25TestCaseOperation2Input) SetURIFooEnum(v string) *InputService25TestShapeInputService25TestCaseOperation2Input {
s.URIFooEnum = &v
return s
}
// SetURIListEnums sets the URIListEnums field's value.
func (s *InputService25TestShapeInputService25TestCaseOperation2Input) SetURIListEnums(v []*string) *InputService25TestShapeInputService25TestCaseOperation2Input {
s.URIListEnums = v
return s
}
type InputService25TestShapeInputService25TestCaseOperation2Output struct {
_ struct{} `type:"structure"`
}
const (
// EnumTypeFoo is a InputService25TestShapeEnumType enum value
EnumTypeFoo = "foo"
// EnumTypeBar is a InputService25TestShapeEnumType enum value
EnumTypeBar = "bar"
// EnumType0 is a InputService25TestShapeEnumType enum value
EnumType0 = "0"
// EnumType1 is a InputService25TestShapeEnumType enum value
EnumType1 = "1"
)
//
// Tests begin here
//
@@ -6013,3 +6280,65 @@ func TestInputService24ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) {
// assert headers
}
func TestInputService25ProtocolTestEnumCase1(t *testing.T) {
svc := NewInputService25ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
input := &InputService25TestShapeInputService25TestCaseOperation2Input{
FooEnum: aws.String("foo"),
HeaderEnum: aws.String("baz"),
ListEnums: []*string{
aws.String("foo"),
aws.String(""),
aws.String("bar"),
},
URIFooEnum: aws.String("bar"),
URIListEnums: []*string{
aws.String("0"),
aws.String(""),
aws.String("1"),
},
}
req, _ := svc.InputService25TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
restxml.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 := util.SortXML(r.Body)
awstesting.AssertXML(t, `<InputShape><FooEnum>foo</FooEnum><ListEnums><member>foo</member><member></member><member>bar</member></ListEnums></InputShape>`, util.Trim(string(body)), InputService25TestShapeInputService25TestCaseOperation2Input{})
// assert URL
awstesting.AssertURL(t, "https://test/Enum/bar?ListEnums=0&ListEnums=&ListEnums=1", r.URL.String())
// assert headers
if e, a := "baz", r.Header.Get("x-amz-enum"); e != a {
t.Errorf("expect %v to be %v", e, a)
}
}
func TestInputService25ProtocolTestEnumCase2(t *testing.T) {
svc := NewInputService25ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
input := &InputService25TestShapeInputService25TestCaseOperation2Input{}
req, _ := svc.InputService25TestCaseOperation2Request(input)
r := req.HTTPRequest
// build request
restxml.Build(req)
if req.Error != nil {
t.Errorf("expect no error, got %v", req.Error)
}
// assert URL
awstesting.AssertURL(t, "https://test/path", r.URL.String())
// assert headers
}

View File

@@ -2009,6 +2009,443 @@ func (s *OutputService12TestShapeOutputService12TestCaseOperation1Output) SetFoo
return s
}
// OutputService13ProtocolTest provides the API operation methods for making requests to
// . See this package's package overview docs
// for details on the service.
//
// OutputService13ProtocolTest methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type OutputService13ProtocolTest struct {
*client.Client
}
// New creates a new instance of the OutputService13ProtocolTest 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 OutputService13ProtocolTest client from just a session.
// svc := outputservice13protocoltest.New(mySession)
//
// // Create a OutputService13ProtocolTest client with additional configuration
// svc := outputservice13protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func NewOutputService13ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService13ProtocolTest {
c := p.ClientConfig("outputservice13protocoltest", cfgs...)
return newOutputService13ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
}
// newClient creates, initializes and returns a new service client instance.
func newOutputService13ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService13ProtocolTest {
svc := &OutputService13ProtocolTest{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: "outputservice13protocoltest",
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
return svc
}
// newRequest creates a new request for a OutputService13ProtocolTest operation and runs any
// custom request initialization.
func (c *OutputService13ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
req := c.NewRequest(op, params, data)
return req
}
const opOutputService13TestCaseOperation1 = "OperationName"
// OutputService13TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the OutputService13TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// 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 OutputService13TestCaseOperation1 for more information on using the OutputService13TestCaseOperation1
// 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 OutputService13TestCaseOperation1Request method.
// req, resp := client.OutputService13TestCaseOperation1Request(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1Request(input *OutputService13TestShapeOutputService13TestCaseOperation1Input) (req *request.Request, output *OutputService13TestShapeOutputService13TestCaseOperation2Input) {
op := &request.Operation{
Name: opOutputService13TestCaseOperation1,
HTTPMethod: "POST",
HTTPPath: "/path",
}
if input == nil {
input = &OutputService13TestShapeOutputService13TestCaseOperation1Input{}
}
output = &OutputService13TestShapeOutputService13TestCaseOperation2Input{}
req = c.newRequest(op, input, output)
return
}
// OutputService13TestCaseOperation1 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 OutputService13TestCaseOperation1 for usage and error information.
func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1(input *OutputService13TestShapeOutputService13TestCaseOperation1Input) (*OutputService13TestShapeOutputService13TestCaseOperation2Input, error) {
req, out := c.OutputService13TestCaseOperation1Request(input)
return out, req.Send()
}
// OutputService13TestCaseOperation1WithContext is the same as OutputService13TestCaseOperation1 with the addition of
// the ability to pass a context and additional request options.
//
// See OutputService13TestCaseOperation1 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 *OutputService13ProtocolTest) OutputService13TestCaseOperation1WithContext(ctx aws.Context, input *OutputService13TestShapeOutputService13TestCaseOperation1Input, opts ...request.Option) (*OutputService13TestShapeOutputService13TestCaseOperation2Input, error) {
req, out := c.OutputService13TestCaseOperation1Request(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opOutputService13TestCaseOperation2 = "OperationName"
// OutputService13TestCaseOperation2Request generates a "aws/request.Request" representing the
// client's request for the OutputService13TestCaseOperation2 operation. The "output" return
// value will be populated with the request's response once the request complets
// 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 OutputService13TestCaseOperation2 for more information on using the OutputService13TestCaseOperation2
// 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 OutputService13TestCaseOperation2Request method.
// req, resp := client.OutputService13TestCaseOperation2Request(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation2Request(input *OutputService13TestShapeOutputService13TestCaseOperation2Input) (req *request.Request, output *OutputService13TestShapeOutputService13TestCaseOperation2Output) {
op := &request.Operation{
Name: opOutputService13TestCaseOperation2,
HTTPMethod: "POST",
HTTPPath: "/path",
}
if input == nil {
input = &OutputService13TestShapeOutputService13TestCaseOperation2Input{}
}
output = &OutputService13TestShapeOutputService13TestCaseOperation2Output{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// OutputService13TestCaseOperation2 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 OutputService13TestCaseOperation2 for usage and error information.
func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation2(input *OutputService13TestShapeOutputService13TestCaseOperation2Input) (*OutputService13TestShapeOutputService13TestCaseOperation2Output, error) {
req, out := c.OutputService13TestCaseOperation2Request(input)
return out, req.Send()
}
// OutputService13TestCaseOperation2WithContext is the same as OutputService13TestCaseOperation2 with the addition of
// the ability to pass a context and additional request options.
//
// See OutputService13TestCaseOperation2 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 *OutputService13ProtocolTest) OutputService13TestCaseOperation2WithContext(ctx aws.Context, input *OutputService13TestShapeOutputService13TestCaseOperation2Input, opts ...request.Option) (*OutputService13TestShapeOutputService13TestCaseOperation2Output, error) {
req, out := c.OutputService13TestCaseOperation2Request(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
type OutputService13TestShapeOutputService13TestCaseOperation1Input struct {
_ struct{} `type:"structure"`
}
type OutputService13TestShapeOutputService13TestCaseOperation2Input struct {
_ struct{} `type:"structure"`
FooEnum *string `type:"string" enum:"OutputService13TestShapeRESTJSONEnumType"`
HeaderEnum *string `location:"header" locationName:"x-amz-enum" type:"string" enum:"OutputService13TestShapeRESTJSONEnumType"`
ListEnums []*string `type:"list"`
}
// SetFooEnum sets the FooEnum field's value.
func (s *OutputService13TestShapeOutputService13TestCaseOperation2Input) SetFooEnum(v string) *OutputService13TestShapeOutputService13TestCaseOperation2Input {
s.FooEnum = &v
return s
}
// SetHeaderEnum sets the HeaderEnum field's value.
func (s *OutputService13TestShapeOutputService13TestCaseOperation2Input) SetHeaderEnum(v string) *OutputService13TestShapeOutputService13TestCaseOperation2Input {
s.HeaderEnum = &v
return s
}
// SetListEnums sets the ListEnums field's value.
func (s *OutputService13TestShapeOutputService13TestCaseOperation2Input) SetListEnums(v []*string) *OutputService13TestShapeOutputService13TestCaseOperation2Input {
s.ListEnums = v
return s
}
type OutputService13TestShapeOutputService13TestCaseOperation2Output struct {
_ struct{} `type:"structure"`
}
const (
// RESTJSONEnumTypeFoo is a OutputService13TestShapeRESTJSONEnumType enum value
RESTJSONEnumTypeFoo = "foo"
// RESTJSONEnumTypeBar is a OutputService13TestShapeRESTJSONEnumType enum value
RESTJSONEnumTypeBar = "bar"
// RESTJSONEnumType0 is a OutputService13TestShapeRESTJSONEnumType enum value
RESTJSONEnumType0 = "0"
// RESTJSONEnumType1 is a OutputService13TestShapeRESTJSONEnumType enum value
RESTJSONEnumType1 = "1"
)
// OutputService14ProtocolTest provides the API operation methods for making requests to
// . See this package's package overview docs
// for details on the service.
//
// OutputService14ProtocolTest methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type OutputService14ProtocolTest struct {
*client.Client
}
// New creates a new instance of the OutputService14ProtocolTest 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 OutputService14ProtocolTest client from just a session.
// svc := outputservice14protocoltest.New(mySession)
//
// // Create a OutputService14ProtocolTest client with additional configuration
// svc := outputservice14protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func NewOutputService14ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService14ProtocolTest {
c := p.ClientConfig("outputservice14protocoltest", cfgs...)
return newOutputService14ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
}
// newClient creates, initializes and returns a new service client instance.
func newOutputService14ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService14ProtocolTest {
svc := &OutputService14ProtocolTest{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: "outputservice14protocoltest",
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
svc.Handlers.Build.PushBackNamed(restxml.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler)
return svc
}
// newRequest creates a new request for a OutputService14ProtocolTest operation and runs any
// custom request initialization.
func (c *OutputService14ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
req := c.NewRequest(op, params, data)
return req
}
const opOutputService14TestCaseOperation1 = "OperationName"
// OutputService14TestCaseOperation1Request generates a "aws/request.Request" representing the
// client's request for the OutputService14TestCaseOperation1 operation. The "output" return
// value will be populated with the request's response once the request complets
// 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 OutputService14TestCaseOperation1 for more information on using the OutputService14TestCaseOperation1
// 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 OutputService14TestCaseOperation1Request method.
// req, resp := client.OutputService14TestCaseOperation1Request(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1Request(input *OutputService14TestShapeOutputService14TestCaseOperation1Input) (req *request.Request, output *OutputService14TestShapeOutputService14TestCaseOperation1Output) {
op := &request.Operation{
Name: opOutputService14TestCaseOperation1,
HTTPMethod: "GET",
HTTPPath: "/path",
}
if input == nil {
input = &OutputService14TestShapeOutputService14TestCaseOperation1Input{}
}
output = &OutputService14TestShapeOutputService14TestCaseOperation1Output{}
req = c.newRequest(op, input, output)
return
}
// OutputService14TestCaseOperation1 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 OutputService14TestCaseOperation1 for usage and error information.
func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1(input *OutputService14TestShapeOutputService14TestCaseOperation1Input) (*OutputService14TestShapeOutputService14TestCaseOperation1Output, error) {
req, out := c.OutputService14TestCaseOperation1Request(input)
return out, req.Send()
}
// OutputService14TestCaseOperation1WithContext is the same as OutputService14TestCaseOperation1 with the addition of
// the ability to pass a context and additional request options.
//
// See OutputService14TestCaseOperation1 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 *OutputService14ProtocolTest) OutputService14TestCaseOperation1WithContext(ctx aws.Context, input *OutputService14TestShapeOutputService14TestCaseOperation1Input, opts ...request.Option) (*OutputService14TestShapeOutputService14TestCaseOperation1Output, error) {
req, out := c.OutputService14TestCaseOperation1Request(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
type OutputService14TestShapeItemDetailShape struct {
_ struct{} `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"`
ID *string `type:"string"`
// Type is a required field
Type *string `locationName:"xsi:type" type:"string" xmlAttribute:"true" required:"true" enum:"OutputService14TestShapeItemType"`
}
// SetID sets the ID field's value.
func (s *OutputService14TestShapeItemDetailShape) SetID(v string) *OutputService14TestShapeItemDetailShape {
s.ID = &v
return s
}
// SetType sets the Type field's value.
func (s *OutputService14TestShapeItemDetailShape) SetType(v string) *OutputService14TestShapeItemDetailShape {
s.Type = &v
return s
}
type OutputService14TestShapeItemShape struct {
_ struct{} `type:"structure"`
ItemDetail *OutputService14TestShapeItemDetailShape `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"`
}
// SetItemDetail sets the ItemDetail field's value.
func (s *OutputService14TestShapeItemShape) SetItemDetail(v *OutputService14TestShapeItemDetailShape) *OutputService14TestShapeItemShape {
s.ItemDetail = v
return s
}
type OutputService14TestShapeOutputService14TestCaseOperation1Input struct {
_ struct{} `type:"structure"`
}
type OutputService14TestShapeOutputService14TestCaseOperation1Output struct {
_ struct{} `type:"structure"`
ListItems []*OutputService14TestShapeItemShape `locationName:"ItemsList" locationNameList:"Item" type:"list"`
}
// SetListItems sets the ListItems field's value.
func (s *OutputService14TestShapeOutputService14TestCaseOperation1Output) SetListItems(v []*OutputService14TestShapeItemShape) *OutputService14TestShapeOutputService14TestCaseOperation1Output {
s.ListItems = v
return s
}
const (
// ItemTypeType1 is a OutputService14TestShapeItemType enum value
ItemTypeType1 = "Type1"
// ItemTypeType2 is a OutputService14TestShapeItemType enum value
ItemTypeType2 = "Type2"
// ItemTypeType3 is a OutputService14TestShapeItemType enum value
ItemTypeType3 = "Type3"
)
//
// Tests begin here
//
@@ -2469,3 +2906,103 @@ func TestOutputService12ProtocolTestEmptyStringCase1(t *testing.T) {
}
}
func TestOutputService13ProtocolTestEnumCase1(t *testing.T) {
svc := NewOutputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("<OperationNameResponse><FooEnum>foo</FooEnum><ListEnums><member>0</member><member>1</member></ListEnums></OperationNameResponse>"))
req, out := svc.OutputService13TestCaseOperation1Request(nil)
req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
// set headers
req.HTTPResponse.Header.Set("x-amz-enum", "baz")
// unmarshal response
restxml.UnmarshalMeta(req)
restxml.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 := "baz", *out.HeaderEnum; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "0", *out.ListEnums[0]; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "1", *out.ListEnums[1]; e != a {
t.Errorf("expect %v, got %v", e, a)
}
}
func TestOutputService13ProtocolTestEnumCase2(t *testing.T) {
svc := NewOutputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte(""))
req, out := svc.OutputService13TestCaseOperation2Request(nil)
req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
// set headers
// unmarshal response
restxml.UnmarshalMeta(req)
restxml.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")
}
}
func TestOutputService14ProtocolTestXMLAttributesCase1(t *testing.T) {
svc := NewOutputService14ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("<SomeOutputDoc xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><ItemsList><Item><ItemDetail xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Type1\"><ID>id1</ID></ItemDetail></Item><Item><ItemDetail xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Type2\"><ID>id2</ID></ItemDetail></Item><Item><ItemDetail xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Type3\"><ID>id3</ID></ItemDetail></Item></ItemsList></SomeOutputDoc>"))
req, out := svc.OutputService14TestCaseOperation1Request(nil)
req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
// set headers
// unmarshal response
restxml.UnmarshalMeta(req)
restxml.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 := "id1", *out.ListItems[0].ItemDetail.ID; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "Type1", *out.ListItems[0].ItemDetail.Type; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "id2", *out.ListItems[1].ItemDetail.ID; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "Type2", *out.ListItems[1].ItemDetail.Type; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "id3", *out.ListItems[2].ItemDetail.ID; e != a {
t.Errorf("expect %v, got %v", e, a)
}
if e, a := "Type3", *out.ListItems[2].ItemDetail.Type; e != a {
t.Errorf("expect %v, got %v", e, a)
}
}