mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-07 22:20:24 +00:00
Update Go AWS SDK to the latest version
This commit is contained in:
committed by
Andrey Smirnov
parent
d08be990ef
commit
94a72b23ff
+2
-1
@@ -21,7 +21,8 @@ func Build(r *request.Request) {
|
||||
"Version": {r.ClientInfo.APIVersion},
|
||||
}
|
||||
if err := queryutil.Parse(body, r.Params, true); err != nil {
|
||||
r.Error = awserr.New("SerializationError", "failed encoding EC2 Query request", err)
|
||||
r.Error = awserr.New(request.ErrCodeSerialization,
|
||||
"failed encoding EC2 Query request", err)
|
||||
}
|
||||
|
||||
if !r.IsPresigned() {
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ func BenchmarkEC2QueryBuild_Complex_ec2AuthorizeSecurityGroupEgress(b *testing.B
|
||||
IpProtocol: aws.String("String"),
|
||||
SourceSecurityGroupName: aws.String("String"),
|
||||
SourceSecurityGroupOwnerId: aws.String("String"),
|
||||
ToPort: aws.Int64(1),
|
||||
ToPort: aws.Int64(1),
|
||||
}
|
||||
|
||||
benchEC2QueryBuild(b, "AuthorizeSecurityGroupEgress", params)
|
||||
|
||||
+432
-71
@@ -75,7 +75,8 @@ func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handler
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "inputservice1protocoltest",
|
||||
ServiceName: "InputService1ProtocolTest",
|
||||
ServiceID: "InputService1ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -108,7 +109,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -139,8 +140,7 @@ func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input
|
||||
|
||||
output = &InputService1TestShapeInputService1TestCaseOperation1Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
|
||||
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
|
||||
req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -228,7 +228,8 @@ func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handler
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "inputservice2protocoltest",
|
||||
ServiceName: "InputService2ProtocolTest",
|
||||
ServiceID: "InputService2ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -261,7 +262,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -292,8 +293,7 @@ func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input
|
||||
|
||||
output = &InputService2TestShapeInputService2TestCaseOperation1Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
|
||||
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
|
||||
req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -389,7 +389,8 @@ func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handler
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "inputservice3protocoltest",
|
||||
ServiceName: "InputService3ProtocolTest",
|
||||
ServiceID: "InputService3ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -422,7 +423,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -453,8 +454,7 @@ func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input
|
||||
|
||||
output = &InputService3TestShapeInputService3TestCaseOperation1Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
|
||||
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
|
||||
req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -546,7 +546,8 @@ func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handler
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "inputservice4protocoltest",
|
||||
ServiceName: "InputService4ProtocolTest",
|
||||
ServiceID: "InputService4ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -579,7 +580,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -610,8 +611,7 @@ func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input
|
||||
|
||||
output = &InputService4TestShapeInputService4TestCaseOperation1Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
|
||||
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
|
||||
req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -715,7 +715,8 @@ func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handler
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "inputservice5protocoltest",
|
||||
ServiceName: "InputService5ProtocolTest",
|
||||
ServiceID: "InputService5ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -748,7 +749,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -779,8 +780,7 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input
|
||||
|
||||
output = &InputService5TestShapeInputService5TestCaseOperation1Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
|
||||
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
|
||||
req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -860,7 +860,8 @@ func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handler
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "inputservice6protocoltest",
|
||||
ServiceName: "InputService6ProtocolTest",
|
||||
ServiceID: "InputService6ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -893,7 +894,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -924,8 +925,7 @@ func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input
|
||||
|
||||
output = &InputService6TestShapeInputService6TestCaseOperation1Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
|
||||
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
|
||||
req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1005,7 +1005,8 @@ func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handler
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "inputservice7protocoltest",
|
||||
ServiceName: "InputService7ProtocolTest",
|
||||
ServiceID: "InputService7ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -1038,7 +1039,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -1069,8 +1070,7 @@ func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input
|
||||
|
||||
output = &InputService7TestShapeInputService7TestCaseOperation1Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
|
||||
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
|
||||
req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1151,7 +1151,8 @@ func newInputService8ProtocolTestClient(cfg aws.Config, handlers request.Handler
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "inputservice8protocoltest",
|
||||
ServiceName: "InputService8ProtocolTest",
|
||||
ServiceID: "InputService8ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -1184,7 +1185,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -1215,8 +1216,7 @@ func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input
|
||||
|
||||
output = &InputService8TestShapeInputService8TestCaseOperation1Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
|
||||
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
|
||||
req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1252,7 +1252,11 @@ func (c *InputService8ProtocolTest) InputService8TestCaseOperation1WithContext(c
|
||||
type InputService8TestShapeInputService8TestCaseOperation1Input struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
TimeArg *time.Time `type:"timestamp" timestampFormat:"iso8601"`
|
||||
TimeArg *time.Time `type:"timestamp"`
|
||||
|
||||
TimeCustom *time.Time `type:"timestamp" timestampFormat:"unixTimestamp"`
|
||||
|
||||
TimeFormat *time.Time `type:"timestamp" timestampFormat:"unixTimestamp"`
|
||||
}
|
||||
|
||||
// SetTimeArg sets the TimeArg field's value.
|
||||
@@ -1261,6 +1265,18 @@ func (s *InputService8TestShapeInputService8TestCaseOperation1Input) SetTimeArg(
|
||||
return s
|
||||
}
|
||||
|
||||
// SetTimeCustom sets the TimeCustom field's value.
|
||||
func (s *InputService8TestShapeInputService8TestCaseOperation1Input) SetTimeCustom(v time.Time) *InputService8TestShapeInputService8TestCaseOperation1Input {
|
||||
s.TimeCustom = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetTimeFormat sets the TimeFormat field's value.
|
||||
func (s *InputService8TestShapeInputService8TestCaseOperation1Input) SetTimeFormat(v time.Time) *InputService8TestShapeInputService8TestCaseOperation1Input {
|
||||
s.TimeFormat = &v
|
||||
return s
|
||||
}
|
||||
|
||||
type InputService8TestShapeInputService8TestCaseOperation1Output struct {
|
||||
_ struct{} `type:"structure"`
|
||||
}
|
||||
@@ -1296,7 +1312,8 @@ func newInputService9ProtocolTestClient(cfg aws.Config, handlers request.Handler
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "inputservice9protocoltest",
|
||||
ServiceName: "InputService9ProtocolTest",
|
||||
ServiceID: "InputService9ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -1329,7 +1346,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -1348,20 +1365,19 @@ const opInputService9TestCaseOperation1 = "OperationName"
|
||||
// if err == nil { // resp is now filled
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
func (c *InputService9ProtocolTest) InputService9TestCaseOperation1Request(input *InputService9TestShapeInputService9TestCaseOperation2Input) (req *request.Request, output *InputService9TestShapeInputService9TestCaseOperation1Output) {
|
||||
func (c *InputService9ProtocolTest) InputService9TestCaseOperation1Request(input *InputService9TestShapeInputService9TestCaseOperation1Input) (req *request.Request, output *InputService9TestShapeInputService9TestCaseOperation1Output) {
|
||||
op := &request.Operation{
|
||||
Name: opInputService9TestCaseOperation1,
|
||||
HTTPPath: "/",
|
||||
}
|
||||
|
||||
if input == nil {
|
||||
input = &InputService9TestShapeInputService9TestCaseOperation2Input{}
|
||||
input = &InputService9TestShapeInputService9TestCaseOperation1Input{}
|
||||
}
|
||||
|
||||
output = &InputService9TestShapeInputService9TestCaseOperation1Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
|
||||
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
|
||||
req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1373,7 +1389,7 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation1Request(input
|
||||
//
|
||||
// See the AWS API reference guide for 's
|
||||
// API operation InputService9TestCaseOperation1 for usage and error information.
|
||||
func (c *InputService9ProtocolTest) InputService9TestCaseOperation1(input *InputService9TestShapeInputService9TestCaseOperation2Input) (*InputService9TestShapeInputService9TestCaseOperation1Output, error) {
|
||||
func (c *InputService9ProtocolTest) InputService9TestCaseOperation1(input *InputService9TestShapeInputService9TestCaseOperation1Input) (*InputService9TestShapeInputService9TestCaseOperation1Output, error) {
|
||||
req, out := c.InputService9TestCaseOperation1Request(input)
|
||||
return out, req.Send()
|
||||
}
|
||||
@@ -1387,7 +1403,7 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation1(input *Input
|
||||
// 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 *InputService9ProtocolTest) InputService9TestCaseOperation1WithContext(ctx aws.Context, input *InputService9TestShapeInputService9TestCaseOperation2Input, opts ...request.Option) (*InputService9TestShapeInputService9TestCaseOperation1Output, error) {
|
||||
func (c *InputService9ProtocolTest) InputService9TestCaseOperation1WithContext(ctx aws.Context, input *InputService9TestShapeInputService9TestCaseOperation1Input, opts ...request.Option) (*InputService9TestShapeInputService9TestCaseOperation1Output, error) {
|
||||
req, out := c.InputService9TestCaseOperation1Request(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
@@ -1399,7 +1415,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -1430,8 +1446,7 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation2Request(input
|
||||
|
||||
output = &InputService9TestShapeInputService9TestCaseOperation2Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
|
||||
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
|
||||
req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1464,6 +1479,18 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation2WithContext(c
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
type InputService9TestShapeInputService9TestCaseOperation1Input struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
Token *string `type:"string" idempotencyToken:"true"`
|
||||
}
|
||||
|
||||
// SetToken sets the Token field's value.
|
||||
func (s *InputService9TestShapeInputService9TestCaseOperation1Input) SetToken(v string) *InputService9TestShapeInputService9TestCaseOperation1Input {
|
||||
s.Token = &v
|
||||
return s
|
||||
}
|
||||
|
||||
type InputService9TestShapeInputService9TestCaseOperation1Output struct {
|
||||
_ struct{} `type:"structure"`
|
||||
}
|
||||
@@ -1515,7 +1542,8 @@ func newInputService10ProtocolTestClient(cfg aws.Config, handlers request.Handle
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "inputservice10protocoltest",
|
||||
ServiceName: "InputService10ProtocolTest",
|
||||
ServiceID: "InputService10ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -1548,7 +1576,7 @@ 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.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -1567,20 +1595,19 @@ const opInputService10TestCaseOperation1 = "OperationName"
|
||||
// if err == nil { // resp is now filled
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
func (c *InputService10ProtocolTest) InputService10TestCaseOperation1Request(input *InputService10TestShapeInputService10TestCaseOperation2Input) (req *request.Request, output *InputService10TestShapeInputService10TestCaseOperation1Output) {
|
||||
func (c *InputService10ProtocolTest) InputService10TestCaseOperation1Request(input *InputService10TestShapeInputService10TestCaseOperation1Input) (req *request.Request, output *InputService10TestShapeInputService10TestCaseOperation1Output) {
|
||||
op := &request.Operation{
|
||||
Name: opInputService10TestCaseOperation1,
|
||||
HTTPPath: "/",
|
||||
}
|
||||
|
||||
if input == nil {
|
||||
input = &InputService10TestShapeInputService10TestCaseOperation2Input{}
|
||||
input = &InputService10TestShapeInputService10TestCaseOperation1Input{}
|
||||
}
|
||||
|
||||
output = &InputService10TestShapeInputService10TestCaseOperation1Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
|
||||
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
|
||||
req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1592,7 +1619,7 @@ func (c *InputService10ProtocolTest) InputService10TestCaseOperation1Request(inp
|
||||
//
|
||||
// See the AWS API reference guide for 's
|
||||
// API operation InputService10TestCaseOperation1 for usage and error information.
|
||||
func (c *InputService10ProtocolTest) InputService10TestCaseOperation1(input *InputService10TestShapeInputService10TestCaseOperation2Input) (*InputService10TestShapeInputService10TestCaseOperation1Output, error) {
|
||||
func (c *InputService10ProtocolTest) InputService10TestCaseOperation1(input *InputService10TestShapeInputService10TestCaseOperation1Input) (*InputService10TestShapeInputService10TestCaseOperation1Output, error) {
|
||||
req, out := c.InputService10TestCaseOperation1Request(input)
|
||||
return out, req.Send()
|
||||
}
|
||||
@@ -1606,7 +1633,7 @@ func (c *InputService10ProtocolTest) InputService10TestCaseOperation1(input *Inp
|
||||
// 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) {
|
||||
func (c *InputService10ProtocolTest) InputService10TestCaseOperation1WithContext(ctx aws.Context, input *InputService10TestShapeInputService10TestCaseOperation1Input, opts ...request.Option) (*InputService10TestShapeInputService10TestCaseOperation1Output, error) {
|
||||
req, out := c.InputService10TestCaseOperation1Request(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
@@ -1618,7 +1645,7 @@ 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.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -1649,8 +1676,7 @@ func (c *InputService10ProtocolTest) InputService10TestCaseOperation2Request(inp
|
||||
|
||||
output = &InputService10TestShapeInputService10TestCaseOperation2Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
|
||||
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
|
||||
req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1683,6 +1709,26 @@ func (c *InputService10ProtocolTest) InputService10TestCaseOperation2WithContext
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
type InputService10TestShapeInputService10TestCaseOperation1Input struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
FooEnum *string `type:"string" enum:"InputService10TestShapeEnumType"`
|
||||
|
||||
ListEnums []*string `type:"list"`
|
||||
}
|
||||
|
||||
// SetFooEnum sets the FooEnum field's value.
|
||||
func (s *InputService10TestShapeInputService10TestCaseOperation1Input) SetFooEnum(v string) *InputService10TestShapeInputService10TestCaseOperation1Input {
|
||||
s.FooEnum = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetListEnums sets the ListEnums field's value.
|
||||
func (s *InputService10TestShapeInputService10TestCaseOperation1Input) SetListEnums(v []*string) *InputService10TestShapeInputService10TestCaseOperation1Input {
|
||||
s.ListEnums = v
|
||||
return s
|
||||
}
|
||||
|
||||
type InputService10TestShapeInputService10TestCaseOperation1Output struct {
|
||||
_ struct{} `type:"structure"`
|
||||
}
|
||||
@@ -1719,6 +1765,263 @@ const (
|
||||
EnumTypeBar = "bar"
|
||||
)
|
||||
|
||||
// InputService11ProtocolTest provides the API operation methods for making requests to
|
||||
// . See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// InputService11ProtocolTest methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type InputService11ProtocolTest struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
// New creates a new instance of the InputService11ProtocolTest 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 InputService11ProtocolTest client from just a session.
|
||||
// svc := inputservice11protocoltest.New(mySession)
|
||||
//
|
||||
// // Create a InputService11ProtocolTest client with additional configuration
|
||||
// svc := inputservice11protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func NewInputService11ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService11ProtocolTest {
|
||||
c := p.ClientConfig("inputservice11protocoltest", cfgs...)
|
||||
return newInputService11ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newInputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService11ProtocolTest {
|
||||
svc := &InputService11ProtocolTest{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "InputService11ProtocolTest",
|
||||
ServiceID: "InputService11ProtocolTest",
|
||||
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 InputService11ProtocolTest operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *InputService11ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
|
||||
req := c.NewRequest(op, params, data)
|
||||
|
||||
return req
|
||||
}
|
||||
|
||||
const opInputService11TestCaseOperation1 = "StaticOp"
|
||||
|
||||
// InputService11TestCaseOperation1Request generates a "aws/request.Request" representing the
|
||||
// client's request for the InputService11TestCaseOperation1 operation. The "output" return
|
||||
// value will be populated with the request's response once the request completes
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// See InputService11TestCaseOperation1 for more information on using the InputService11TestCaseOperation1
|
||||
// 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 InputService11TestCaseOperation1Request method.
|
||||
// req, resp := client.InputService11TestCaseOperation1Request(params)
|
||||
//
|
||||
// err := req.Send()
|
||||
// if err == nil { // resp is now filled
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
func (c *InputService11ProtocolTest) InputService11TestCaseOperation1Request(input *InputService11TestShapeInputService11TestCaseOperation1Input) (req *request.Request, output *InputService11TestShapeInputService11TestCaseOperation1Output) {
|
||||
op := &request.Operation{
|
||||
Name: opInputService11TestCaseOperation1,
|
||||
HTTPPath: "/",
|
||||
}
|
||||
|
||||
if input == nil {
|
||||
input = &InputService11TestShapeInputService11TestCaseOperation1Input{}
|
||||
}
|
||||
|
||||
output = &InputService11TestShapeInputService11TestCaseOperation1Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("data-", nil))
|
||||
req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler)
|
||||
return
|
||||
}
|
||||
|
||||
// InputService11TestCaseOperation1 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 InputService11TestCaseOperation1 for usage and error information.
|
||||
func (c *InputService11ProtocolTest) InputService11TestCaseOperation1(input *InputService11TestShapeInputService11TestCaseOperation1Input) (*InputService11TestShapeInputService11TestCaseOperation1Output, error) {
|
||||
req, out := c.InputService11TestCaseOperation1Request(input)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// InputService11TestCaseOperation1WithContext is the same as InputService11TestCaseOperation1 with the addition of
|
||||
// the ability to pass a context and additional request options.
|
||||
//
|
||||
// See InputService11TestCaseOperation1 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 *InputService11ProtocolTest) InputService11TestCaseOperation1WithContext(ctx aws.Context, input *InputService11TestShapeInputService11TestCaseOperation1Input, opts ...request.Option) (*InputService11TestShapeInputService11TestCaseOperation1Output, error) {
|
||||
req, out := c.InputService11TestCaseOperation1Request(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
const opInputService11TestCaseOperation2 = "MemberRefOp"
|
||||
|
||||
// InputService11TestCaseOperation2Request generates a "aws/request.Request" representing the
|
||||
// client's request for the InputService11TestCaseOperation2 operation. The "output" return
|
||||
// value will be populated with the request's response once the request completes
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// See InputService11TestCaseOperation2 for more information on using the InputService11TestCaseOperation2
|
||||
// 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 InputService11TestCaseOperation2Request method.
|
||||
// req, resp := client.InputService11TestCaseOperation2Request(params)
|
||||
//
|
||||
// err := req.Send()
|
||||
// if err == nil { // resp is now filled
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
func (c *InputService11ProtocolTest) InputService11TestCaseOperation2Request(input *InputService11TestShapeInputService11TestCaseOperation2Input) (req *request.Request, output *InputService11TestShapeInputService11TestCaseOperation2Output) {
|
||||
op := &request.Operation{
|
||||
Name: opInputService11TestCaseOperation2,
|
||||
HTTPPath: "/",
|
||||
}
|
||||
|
||||
if input == nil {
|
||||
input = &InputService11TestShapeInputService11TestCaseOperation2Input{}
|
||||
}
|
||||
|
||||
output = &InputService11TestShapeInputService11TestCaseOperation2Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("foo-{Name}.", input.hostLabels))
|
||||
req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler)
|
||||
return
|
||||
}
|
||||
|
||||
// InputService11TestCaseOperation2 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 InputService11TestCaseOperation2 for usage and error information.
|
||||
func (c *InputService11ProtocolTest) InputService11TestCaseOperation2(input *InputService11TestShapeInputService11TestCaseOperation2Input) (*InputService11TestShapeInputService11TestCaseOperation2Output, error) {
|
||||
req, out := c.InputService11TestCaseOperation2Request(input)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// InputService11TestCaseOperation2WithContext is the same as InputService11TestCaseOperation2 with the addition of
|
||||
// the ability to pass a context and additional request options.
|
||||
//
|
||||
// See InputService11TestCaseOperation2 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 *InputService11ProtocolTest) InputService11TestCaseOperation2WithContext(ctx aws.Context, input *InputService11TestShapeInputService11TestCaseOperation2Input, opts ...request.Option) (*InputService11TestShapeInputService11TestCaseOperation2Output, error) {
|
||||
req, out := c.InputService11TestCaseOperation2Request(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
type InputService11TestShapeInputService11TestCaseOperation1Input struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
Name *string `type:"string"`
|
||||
}
|
||||
|
||||
// SetName sets the Name field's value.
|
||||
func (s *InputService11TestShapeInputService11TestCaseOperation1Input) SetName(v string) *InputService11TestShapeInputService11TestCaseOperation1Input {
|
||||
s.Name = &v
|
||||
return s
|
||||
}
|
||||
|
||||
type InputService11TestShapeInputService11TestCaseOperation1Output struct {
|
||||
_ struct{} `type:"structure"`
|
||||
}
|
||||
|
||||
type InputService11TestShapeInputService11TestCaseOperation2Input struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// Name is a required field
|
||||
Name *string `type:"string" required:"true"`
|
||||
}
|
||||
|
||||
// Validate inspects the fields of the type to determine if they are valid.
|
||||
func (s *InputService11TestShapeInputService11TestCaseOperation2Input) Validate() error {
|
||||
invalidParams := request.ErrInvalidParams{Context: "InputService11TestShapeInputService11TestCaseOperation2Input"}
|
||||
if s.Name == nil {
|
||||
invalidParams.Add(request.NewErrParamRequired("Name"))
|
||||
}
|
||||
if s.Name != nil && len(*s.Name) < 1 {
|
||||
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
|
||||
}
|
||||
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetName sets the Name field's value.
|
||||
func (s *InputService11TestShapeInputService11TestCaseOperation2Input) SetName(v string) *InputService11TestShapeInputService11TestCaseOperation2Input {
|
||||
s.Name = &v
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *InputService11TestShapeInputService11TestCaseOperation2Input) hostLabels() map[string]string {
|
||||
return map[string]string{
|
||||
"Name": aws.StringValue(s.Name),
|
||||
}
|
||||
}
|
||||
|
||||
type InputService11TestShapeInputService11TestCaseOperation2Output struct {
|
||||
_ struct{} `type:"structure"`
|
||||
}
|
||||
|
||||
//
|
||||
// Tests begin here
|
||||
//
|
||||
@@ -1733,7 +2036,7 @@ func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) {
|
||||
r := req.HTTPRequest
|
||||
|
||||
// build request
|
||||
ec2query.Build(req)
|
||||
req.Build()
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect no error, got %v", req.Error)
|
||||
}
|
||||
@@ -1763,7 +2066,7 @@ func TestInputService2ProtocolTestStructureWithLocationNameAndQueryNameAppliedTo
|
||||
r := req.HTTPRequest
|
||||
|
||||
// build request
|
||||
ec2query.Build(req)
|
||||
req.Build()
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect no error, got %v", req.Error)
|
||||
}
|
||||
@@ -1793,7 +2096,7 @@ func TestInputService3ProtocolTestNestedStructureMembersCase1(t *testing.T) {
|
||||
r := req.HTTPRequest
|
||||
|
||||
// build request
|
||||
ec2query.Build(req)
|
||||
req.Build()
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect no error, got %v", req.Error)
|
||||
}
|
||||
@@ -1840,7 +2143,7 @@ func TestInputService4ProtocolTestListTypesCase1(t *testing.T) {
|
||||
r := req.HTTPRequest
|
||||
|
||||
// build request
|
||||
ec2query.Build(req)
|
||||
req.Build()
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect no error, got %v", req.Error)
|
||||
}
|
||||
@@ -1872,7 +2175,7 @@ func TestInputService5ProtocolTestListWithLocationNameAppliedToMemberCase1(t *te
|
||||
r := req.HTTPRequest
|
||||
|
||||
// build request
|
||||
ec2query.Build(req)
|
||||
req.Build()
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect no error, got %v", req.Error)
|
||||
}
|
||||
@@ -1904,7 +2207,7 @@ func TestInputService6ProtocolTestListWithLocationNameAndQueryNameCase1(t *testi
|
||||
r := req.HTTPRequest
|
||||
|
||||
// build request
|
||||
ec2query.Build(req)
|
||||
req.Build()
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect no error, got %v", req.Error)
|
||||
}
|
||||
@@ -1932,7 +2235,7 @@ func TestInputService7ProtocolTestBase64EncodedBlobsCase1(t *testing.T) {
|
||||
r := req.HTTPRequest
|
||||
|
||||
// build request
|
||||
ec2query.Build(req)
|
||||
req.Build()
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect no error, got %v", req.Error)
|
||||
}
|
||||
@@ -1954,13 +2257,15 @@ func TestInputService7ProtocolTestBase64EncodedBlobsCase1(t *testing.T) {
|
||||
func TestInputService8ProtocolTestTimestampValuesCase1(t *testing.T) {
|
||||
svc := NewInputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
|
||||
input := &InputService8TestShapeInputService8TestCaseOperation1Input{
|
||||
TimeArg: aws.Time(time.Unix(1422172800, 0)),
|
||||
TimeArg: aws.Time(time.Unix(1422172800, 0)),
|
||||
TimeCustom: aws.Time(time.Unix(1422172800, 0)),
|
||||
TimeFormat: aws.Time(time.Unix(1422172800, 0)),
|
||||
}
|
||||
req, _ := svc.InputService8TestCaseOperation1Request(input)
|
||||
r := req.HTTPRequest
|
||||
|
||||
// build request
|
||||
ec2query.Build(req)
|
||||
req.Build()
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect no error, got %v", req.Error)
|
||||
}
|
||||
@@ -1970,7 +2275,7 @@ func TestInputService8ProtocolTestTimestampValuesCase1(t *testing.T) {
|
||||
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)))
|
||||
awstesting.AssertQuery(t, `Action=OperationName&TimeArg=2015-01-25T08%3A00%3A00Z&TimeCustom=1422172800&TimeFormat=1422172800&Version=2014-01-01`, util.Trim(string(body)))
|
||||
|
||||
// assert URL
|
||||
awstesting.AssertURL(t, "https://test/", r.URL.String())
|
||||
@@ -1981,14 +2286,14 @@ func TestInputService8ProtocolTestTimestampValuesCase1(t *testing.T) {
|
||||
|
||||
func TestInputService9ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) {
|
||||
svc := NewInputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
|
||||
input := &InputService9TestShapeInputService9TestCaseOperation2Input{
|
||||
input := &InputService9TestShapeInputService9TestCaseOperation1Input{
|
||||
Token: aws.String("abc123"),
|
||||
}
|
||||
req, _ := svc.InputService9TestCaseOperation1Request(input)
|
||||
r := req.HTTPRequest
|
||||
|
||||
// build request
|
||||
ec2query.Build(req)
|
||||
req.Build()
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect no error, got %v", req.Error)
|
||||
}
|
||||
@@ -2014,7 +2319,7 @@ func TestInputService9ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) {
|
||||
r := req.HTTPRequest
|
||||
|
||||
// build request
|
||||
ec2query.Build(req)
|
||||
req.Build()
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect no error, got %v", req.Error)
|
||||
}
|
||||
@@ -2035,7 +2340,7 @@ func TestInputService9ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) {
|
||||
|
||||
func TestInputService10ProtocolTestEnumCase1(t *testing.T) {
|
||||
svc := NewInputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")})
|
||||
input := &InputService10TestShapeInputService10TestCaseOperation2Input{
|
||||
input := &InputService10TestShapeInputService10TestCaseOperation1Input{
|
||||
ListEnums: []*string{
|
||||
aws.String("foo"),
|
||||
aws.String(""),
|
||||
@@ -2046,7 +2351,7 @@ func TestInputService10ProtocolTestEnumCase1(t *testing.T) {
|
||||
r := req.HTTPRequest
|
||||
|
||||
// build request
|
||||
ec2query.Build(req)
|
||||
req.Build()
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect no error, got %v", req.Error)
|
||||
}
|
||||
@@ -2072,7 +2377,7 @@ func TestInputService10ProtocolTestEnumCase2(t *testing.T) {
|
||||
r := req.HTTPRequest
|
||||
|
||||
// build request
|
||||
ec2query.Build(req)
|
||||
req.Build()
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect no error, got %v", req.Error)
|
||||
}
|
||||
@@ -2090,3 +2395,59 @@ func TestInputService10ProtocolTestEnumCase2(t *testing.T) {
|
||||
// assert headers
|
||||
|
||||
}
|
||||
|
||||
func TestInputService11ProtocolTestEndpointHostTraitCase1(t *testing.T) {
|
||||
svc := NewInputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://service.region.amazonaws.com")})
|
||||
input := &InputService11TestShapeInputService11TestCaseOperation1Input{
|
||||
Name: aws.String("myname"),
|
||||
}
|
||||
req, _ := svc.InputService11TestCaseOperation1Request(input)
|
||||
r := req.HTTPRequest
|
||||
|
||||
// build request
|
||||
req.Build()
|
||||
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=StaticOp&Name=myname&Version=2014-01-01`, util.Trim(string(body)))
|
||||
|
||||
// assert URL
|
||||
awstesting.AssertURL(t, "https://data-service.region.amazonaws.com/", r.URL.String())
|
||||
|
||||
// assert headers
|
||||
|
||||
}
|
||||
|
||||
func TestInputService11ProtocolTestEndpointHostTraitCase2(t *testing.T) {
|
||||
svc := NewInputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://service.region.amazonaws.com")})
|
||||
input := &InputService11TestShapeInputService11TestCaseOperation2Input{
|
||||
Name: aws.String("myname"),
|
||||
}
|
||||
req, _ := svc.InputService11TestCaseOperation2Request(input)
|
||||
r := req.HTTPRequest
|
||||
|
||||
// build request
|
||||
req.Build()
|
||||
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=MemberRefOp&Name=myname&Version=2014-01-01`, util.Trim(string(body)))
|
||||
|
||||
// assert URL
|
||||
awstesting.AssertURL(t, "https://foo-myname.service.region.amazonaws.com/", r.URL.String())
|
||||
|
||||
// assert headers
|
||||
|
||||
}
|
||||
|
||||
+24
-10
@@ -4,7 +4,6 @@ package ec2query
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"io"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
@@ -27,7 +26,12 @@ func Unmarshal(r *request.Request) {
|
||||
decoder := xml.NewDecoder(r.HTTPResponse.Body)
|
||||
err := xmlutil.UnmarshalXML(r.Data, decoder, "")
|
||||
if err != nil {
|
||||
r.Error = awserr.New("SerializationError", "failed decoding EC2 Query response", err)
|
||||
r.Error = awserr.NewRequestFailure(
|
||||
awserr.New(request.ErrCodeSerialization,
|
||||
"failed decoding EC2 Query response", err),
|
||||
r.HTTPResponse.StatusCode,
|
||||
r.RequestID,
|
||||
)
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -35,7 +39,11 @@ func Unmarshal(r *request.Request) {
|
||||
|
||||
// UnmarshalMeta unmarshals response headers for the EC2 protocol.
|
||||
func UnmarshalMeta(r *request.Request) {
|
||||
// TODO implement unmarshaling of request IDs
|
||||
r.RequestID = r.HTTPResponse.Header.Get("X-Amzn-Requestid")
|
||||
if r.RequestID == "" {
|
||||
// Alternative version of request id in the header
|
||||
r.RequestID = r.HTTPResponse.Header.Get("X-Amz-Request-Id")
|
||||
}
|
||||
}
|
||||
|
||||
type xmlErrorResponse struct {
|
||||
@@ -49,15 +57,21 @@ type xmlErrorResponse struct {
|
||||
func UnmarshalError(r *request.Request) {
|
||||
defer r.HTTPResponse.Body.Close()
|
||||
|
||||
resp := &xmlErrorResponse{}
|
||||
err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp)
|
||||
if err != nil && err != io.EOF {
|
||||
r.Error = awserr.New("SerializationError", "failed decoding EC2 Query error response", err)
|
||||
} else {
|
||||
var respErr xmlErrorResponse
|
||||
err := xmlutil.UnmarshalXMLError(&respErr, r.HTTPResponse.Body)
|
||||
if err != nil {
|
||||
r.Error = awserr.NewRequestFailure(
|
||||
awserr.New(resp.Code, resp.Message, nil),
|
||||
awserr.New(request.ErrCodeSerialization,
|
||||
"failed to unmarshal error message", err),
|
||||
r.HTTPResponse.StatusCode,
|
||||
resp.RequestID,
|
||||
r.RequestID,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
r.Error = awserr.NewRequestFailure(
|
||||
awserr.New(respErr.Code, respErr.Message, nil),
|
||||
r.HTTPResponse.StatusCode,
|
||||
respErr.RequestID,
|
||||
)
|
||||
}
|
||||
|
||||
Generated
Vendored
+82
@@ -0,0 +1,82 @@
|
||||
// +build go1.8
|
||||
|
||||
package ec2query
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
)
|
||||
|
||||
func TestUnmarshalError(t *testing.T) {
|
||||
cases := map[string]struct {
|
||||
Request *request.Request
|
||||
Code, Msg string
|
||||
ReqID string
|
||||
Status int
|
||||
}{
|
||||
"ErrorResponse": {
|
||||
Request: &request.Request{
|
||||
HTTPResponse: &http.Response{
|
||||
StatusCode: 400,
|
||||
Header: http.Header{},
|
||||
Body: ioutil.NopCloser(strings.NewReader(
|
||||
`<Response>
|
||||
<Errors>
|
||||
<Error>
|
||||
<Code>codeAbc</Code>
|
||||
<Message>msg123</Message>
|
||||
</Error>
|
||||
</Errors>
|
||||
<RequestID>reqID123</RequestID>
|
||||
</Response>`)),
|
||||
},
|
||||
},
|
||||
Code: "codeAbc", Msg: "msg123",
|
||||
Status: 400, ReqID: "reqID123",
|
||||
},
|
||||
"unknown tag": {
|
||||
Request: &request.Request{
|
||||
HTTPResponse: &http.Response{
|
||||
StatusCode: 400,
|
||||
Header: http.Header{},
|
||||
Body: ioutil.NopCloser(strings.NewReader(
|
||||
`<Hello>
|
||||
<World>.</World>
|
||||
</Hello>`)),
|
||||
},
|
||||
},
|
||||
Code: request.ErrCodeSerialization,
|
||||
Msg: "failed to unmarshal error message",
|
||||
Status: 400,
|
||||
},
|
||||
}
|
||||
|
||||
for name, c := range cases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
r := c.Request
|
||||
UnmarshalError(r)
|
||||
if r.Error == nil {
|
||||
t.Fatalf("expect error, got none")
|
||||
}
|
||||
|
||||
aerr := r.Error.(awserr.RequestFailure)
|
||||
if e, a := c.Code, aerr.Code(); e != a {
|
||||
t.Errorf("expect %v code, got %v", e, a)
|
||||
}
|
||||
if e, a := c.Msg, aerr.Message(); e != a {
|
||||
t.Errorf("expect %q message, got %q", e, a)
|
||||
}
|
||||
if e, a := c.ReqID, aerr.RequestID(); e != a {
|
||||
t.Errorf("expect %v request ID, got %v", e, a)
|
||||
}
|
||||
if e, a := c.Status, aerr.StatusCode(); e != a {
|
||||
t.Errorf("expect %v status code, got %v", e, a)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
+283
-47
@@ -75,7 +75,8 @@ func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handle
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice1protocoltest",
|
||||
ServiceName: "OutputService1ProtocolTest",
|
||||
ServiceID: "OutputService1ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -108,7 +109,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -274,7 +275,8 @@ func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handle
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice2protocoltest",
|
||||
ServiceName: "OutputService2ProtocolTest",
|
||||
ServiceID: "OutputService2ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -307,7 +309,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -418,7 +420,8 @@ func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handle
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice3protocoltest",
|
||||
ServiceName: "OutputService3ProtocolTest",
|
||||
ServiceID: "OutputService3ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -451,7 +454,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -561,7 +564,8 @@ func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handle
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice4protocoltest",
|
||||
ServiceName: "OutputService4ProtocolTest",
|
||||
ServiceID: "OutputService4ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -594,7 +598,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -704,7 +708,8 @@ func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handle
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice5protocoltest",
|
||||
ServiceName: "OutputService5ProtocolTest",
|
||||
ServiceID: "OutputService5ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -737,7 +742,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -847,7 +852,8 @@ func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handle
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice6protocoltest",
|
||||
ServiceName: "OutputService6ProtocolTest",
|
||||
ServiceID: "OutputService6ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -880,7 +886,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -1002,7 +1008,8 @@ func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handle
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice7protocoltest",
|
||||
ServiceName: "OutputService7ProtocolTest",
|
||||
ServiceID: "OutputService7ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -1035,7 +1042,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -1145,7 +1152,8 @@ func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handle
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice8protocoltest",
|
||||
ServiceName: "OutputService8ProtocolTest",
|
||||
ServiceID: "OutputService8ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -1178,7 +1186,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -1288,7 +1296,8 @@ func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handle
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice9protocoltest",
|
||||
ServiceName: "OutputService9ProtocolTest",
|
||||
ServiceID: "OutputService9ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -1321,7 +1330,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 completes
|
||||
// successfuly.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -1431,7 +1440,8 @@ func newOutputService10ProtocolTestClient(cfg aws.Config, handlers request.Handl
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice10protocoltest",
|
||||
ServiceName: "OutputService10ProtocolTest",
|
||||
ServiceID: "OutputService10ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -1464,7 +1474,7 @@ 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.
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
@@ -1534,28 +1544,216 @@ type OutputService10TestShapeOutputService10TestCaseOperation1Input struct {
|
||||
type OutputService10TestShapeOutputService10TestCaseOperation1Output struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
FooEnum *string `type:"string" enum:"OutputService10TestShapeEC2EnumType"`
|
||||
StructMember *OutputService10TestShapeTimeContainer `type:"structure"`
|
||||
|
||||
TimeArg *time.Time `type:"timestamp"`
|
||||
|
||||
TimeCustom *time.Time `type:"timestamp" timestampFormat:"rfc822"`
|
||||
|
||||
TimeFormat *time.Time `type:"timestamp" timestampFormat:"unixTimestamp"`
|
||||
}
|
||||
|
||||
// SetStructMember sets the StructMember field's value.
|
||||
func (s *OutputService10TestShapeOutputService10TestCaseOperation1Output) SetStructMember(v *OutputService10TestShapeTimeContainer) *OutputService10TestShapeOutputService10TestCaseOperation1Output {
|
||||
s.StructMember = v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetTimeArg sets the TimeArg field's value.
|
||||
func (s *OutputService10TestShapeOutputService10TestCaseOperation1Output) SetTimeArg(v time.Time) *OutputService10TestShapeOutputService10TestCaseOperation1Output {
|
||||
s.TimeArg = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetTimeCustom sets the TimeCustom field's value.
|
||||
func (s *OutputService10TestShapeOutputService10TestCaseOperation1Output) SetTimeCustom(v time.Time) *OutputService10TestShapeOutputService10TestCaseOperation1Output {
|
||||
s.TimeCustom = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetTimeFormat sets the TimeFormat field's value.
|
||||
func (s *OutputService10TestShapeOutputService10TestCaseOperation1Output) SetTimeFormat(v time.Time) *OutputService10TestShapeOutputService10TestCaseOperation1Output {
|
||||
s.TimeFormat = &v
|
||||
return s
|
||||
}
|
||||
|
||||
type OutputService10TestShapeTimeContainer struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
Bar *time.Time `locationName:"bar" type:"timestamp" timestampFormat:"unixTimestamp"`
|
||||
|
||||
Foo *time.Time `locationName:"foo" type:"timestamp"`
|
||||
}
|
||||
|
||||
// SetBar sets the Bar field's value.
|
||||
func (s *OutputService10TestShapeTimeContainer) SetBar(v time.Time) *OutputService10TestShapeTimeContainer {
|
||||
s.Bar = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetFoo sets the Foo field's value.
|
||||
func (s *OutputService10TestShapeTimeContainer) SetFoo(v time.Time) *OutputService10TestShapeTimeContainer {
|
||||
s.Foo = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// OutputService11ProtocolTest provides the API operation methods for making requests to
|
||||
// . See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// OutputService11ProtocolTest methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type OutputService11ProtocolTest struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
// New creates a new instance of the OutputService11ProtocolTest 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 OutputService11ProtocolTest client from just a session.
|
||||
// svc := outputservice11protocoltest.New(mySession)
|
||||
//
|
||||
// // Create a OutputService11ProtocolTest client with additional configuration
|
||||
// svc := outputservice11protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func NewOutputService11ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService11ProtocolTest {
|
||||
c := p.ClientConfig("outputservice11protocoltest", cfgs...)
|
||||
return newOutputService11ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newOutputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService11ProtocolTest {
|
||||
svc := &OutputService11ProtocolTest{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "OutputService11ProtocolTest",
|
||||
ServiceID: "OutputService11ProtocolTest",
|
||||
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 OutputService11ProtocolTest operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *OutputService11ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
|
||||
req := c.NewRequest(op, params, data)
|
||||
|
||||
return req
|
||||
}
|
||||
|
||||
const opOutputService11TestCaseOperation1 = "OperationName"
|
||||
|
||||
// OutputService11TestCaseOperation1Request generates a "aws/request.Request" representing the
|
||||
// client's request for the OutputService11TestCaseOperation1 operation. The "output" return
|
||||
// value will be populated with the request's response once the request completes
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// See OutputService11TestCaseOperation1 for more information on using the OutputService11TestCaseOperation1
|
||||
// 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 OutputService11TestCaseOperation1Request method.
|
||||
// req, resp := client.OutputService11TestCaseOperation1Request(params)
|
||||
//
|
||||
// err := req.Send()
|
||||
// if err == nil { // resp is now filled
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1Request(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (req *request.Request, output *OutputService11TestShapeOutputService11TestCaseOperation1Output) {
|
||||
op := &request.Operation{
|
||||
Name: opOutputService11TestCaseOperation1,
|
||||
HTTPPath: "/",
|
||||
}
|
||||
|
||||
if input == nil {
|
||||
input = &OutputService11TestShapeOutputService11TestCaseOperation1Input{}
|
||||
}
|
||||
|
||||
output = &OutputService11TestShapeOutputService11TestCaseOperation1Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
// OutputService11TestCaseOperation1 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 OutputService11TestCaseOperation1 for usage and error information.
|
||||
func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (*OutputService11TestShapeOutputService11TestCaseOperation1Output, error) {
|
||||
req, out := c.OutputService11TestCaseOperation1Request(input)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// OutputService11TestCaseOperation1WithContext is the same as OutputService11TestCaseOperation1 with the addition of
|
||||
// the ability to pass a context and additional request options.
|
||||
//
|
||||
// See OutputService11TestCaseOperation1 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 *OutputService11ProtocolTest) OutputService11TestCaseOperation1WithContext(ctx aws.Context, input *OutputService11TestShapeOutputService11TestCaseOperation1Input, opts ...request.Option) (*OutputService11TestShapeOutputService11TestCaseOperation1Output, error) {
|
||||
req, out := c.OutputService11TestCaseOperation1Request(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
type OutputService11TestShapeOutputService11TestCaseOperation1Input struct {
|
||||
_ struct{} `type:"structure"`
|
||||
}
|
||||
|
||||
type OutputService11TestShapeOutputService11TestCaseOperation1Output struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
FooEnum *string `type:"string" enum:"OutputService11TestShapeEC2EnumType"`
|
||||
|
||||
ListEnums []*string `type:"list"`
|
||||
}
|
||||
|
||||
// SetFooEnum sets the FooEnum field's value.
|
||||
func (s *OutputService10TestShapeOutputService10TestCaseOperation1Output) SetFooEnum(v string) *OutputService10TestShapeOutputService10TestCaseOperation1Output {
|
||||
func (s *OutputService11TestShapeOutputService11TestCaseOperation1Output) SetFooEnum(v string) *OutputService11TestShapeOutputService11TestCaseOperation1Output {
|
||||
s.FooEnum = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetListEnums sets the ListEnums field's value.
|
||||
func (s *OutputService10TestShapeOutputService10TestCaseOperation1Output) SetListEnums(v []*string) *OutputService10TestShapeOutputService10TestCaseOperation1Output {
|
||||
func (s *OutputService11TestShapeOutputService11TestCaseOperation1Output) SetListEnums(v []*string) *OutputService11TestShapeOutputService11TestCaseOperation1Output {
|
||||
s.ListEnums = v
|
||||
return s
|
||||
}
|
||||
|
||||
const (
|
||||
// EC2EnumTypeFoo is a OutputService10TestShapeEC2EnumType enum value
|
||||
// EC2EnumTypeFoo is a OutputService11TestShapeEC2EnumType enum value
|
||||
EC2EnumTypeFoo = "foo"
|
||||
|
||||
// EC2EnumTypeBar is a OutputService10TestShapeEC2EnumType enum value
|
||||
// EC2EnumTypeBar is a OutputService11TestShapeEC2EnumType enum value
|
||||
EC2EnumTypeBar = "bar"
|
||||
)
|
||||
|
||||
@@ -1573,8 +1771,8 @@ func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
ec2query.UnmarshalMeta(req)
|
||||
ec2query.Unmarshal(req)
|
||||
req.Handlers.UnmarshalMeta.Run(req)
|
||||
req.Handlers.Unmarshal.Run(req)
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect not error, got %v", req.Error)
|
||||
}
|
||||
@@ -1620,8 +1818,8 @@ func TestOutputService2ProtocolTestBlobCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
ec2query.UnmarshalMeta(req)
|
||||
ec2query.Unmarshal(req)
|
||||
req.Handlers.UnmarshalMeta.Run(req)
|
||||
req.Handlers.Unmarshal.Run(req)
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect not error, got %v", req.Error)
|
||||
}
|
||||
@@ -1646,8 +1844,8 @@ func TestOutputService3ProtocolTestListsCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
ec2query.UnmarshalMeta(req)
|
||||
ec2query.Unmarshal(req)
|
||||
req.Handlers.UnmarshalMeta.Run(req)
|
||||
req.Handlers.Unmarshal.Run(req)
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect not error, got %v", req.Error)
|
||||
}
|
||||
@@ -1675,8 +1873,8 @@ func TestOutputService4ProtocolTestListWithCustomMemberNameCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
ec2query.UnmarshalMeta(req)
|
||||
ec2query.Unmarshal(req)
|
||||
req.Handlers.UnmarshalMeta.Run(req)
|
||||
req.Handlers.Unmarshal.Run(req)
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect not error, got %v", req.Error)
|
||||
}
|
||||
@@ -1704,8 +1902,8 @@ func TestOutputService5ProtocolTestFlattenedListCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
ec2query.UnmarshalMeta(req)
|
||||
ec2query.Unmarshal(req)
|
||||
req.Handlers.UnmarshalMeta.Run(req)
|
||||
req.Handlers.Unmarshal.Run(req)
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect not error, got %v", req.Error)
|
||||
}
|
||||
@@ -1733,8 +1931,8 @@ func TestOutputService6ProtocolTestNormalMapCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
ec2query.UnmarshalMeta(req)
|
||||
ec2query.Unmarshal(req)
|
||||
req.Handlers.UnmarshalMeta.Run(req)
|
||||
req.Handlers.Unmarshal.Run(req)
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect not error, got %v", req.Error)
|
||||
}
|
||||
@@ -1762,8 +1960,8 @@ func TestOutputService7ProtocolTestFlattenedMapCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
ec2query.UnmarshalMeta(req)
|
||||
ec2query.Unmarshal(req)
|
||||
req.Handlers.UnmarshalMeta.Run(req)
|
||||
req.Handlers.Unmarshal.Run(req)
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect not error, got %v", req.Error)
|
||||
}
|
||||
@@ -1791,8 +1989,8 @@ func TestOutputService8ProtocolTestNamedMapCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
ec2query.UnmarshalMeta(req)
|
||||
ec2query.Unmarshal(req)
|
||||
req.Handlers.UnmarshalMeta.Run(req)
|
||||
req.Handlers.Unmarshal.Run(req)
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect not error, got %v", req.Error)
|
||||
}
|
||||
@@ -1820,8 +2018,8 @@ func TestOutputService9ProtocolTestEmptyStringCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
ec2query.UnmarshalMeta(req)
|
||||
ec2query.Unmarshal(req)
|
||||
req.Handlers.UnmarshalMeta.Run(req)
|
||||
req.Handlers.Unmarshal.Run(req)
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect not error, got %v", req.Error)
|
||||
}
|
||||
@@ -1836,18 +2034,56 @@ func TestOutputService9ProtocolTestEmptyStringCase1(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
func TestOutputService10ProtocolTestEnumOutputCase1(t *testing.T) {
|
||||
func TestOutputService10ProtocolTestTimestampMembersCase1(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>"))
|
||||
buf := bytes.NewReader([]byte("<OperationNameResponse><StructMember><foo>2014-04-29T18:30:38Z</foo><bar>1398796238</bar></StructMember><TimeArg>2014-04-29T18:30:38Z</TimeArg><TimeCustom>Tue, 29 Apr 2014 18:30:38 GMT</TimeCustom><TimeFormat>1398796238</TimeFormat><RequestId>requestid</RequestId></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)
|
||||
req.Handlers.UnmarshalMeta.Run(req)
|
||||
req.Handlers.Unmarshal.Run(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 := time.Unix(1.398796238e+09, 0).UTC().String(), out.StructMember.Bar.UTC().String(); e != a {
|
||||
t.Errorf("expect %v, got %v", e, a)
|
||||
}
|
||||
if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.StructMember.Foo.UTC().String(); e != a {
|
||||
t.Errorf("expect %v, got %v", e, a)
|
||||
}
|
||||
if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.TimeArg.UTC().String(); e != a {
|
||||
t.Errorf("expect %v, got %v", e, a)
|
||||
}
|
||||
if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.TimeCustom.UTC().String(); e != a {
|
||||
t.Errorf("expect %v, got %v", e, a)
|
||||
}
|
||||
if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.TimeFormat.UTC().String(); e != a {
|
||||
t.Errorf("expect %v, got %v", e, a)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestOutputService11ProtocolTestEnumOutputCase1(t *testing.T) {
|
||||
svc := NewOutputService11ProtocolTest(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.OutputService11TestCaseOperation1Request(nil)
|
||||
req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
|
||||
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
req.Handlers.UnmarshalMeta.Run(req)
|
||||
req.Handlers.Unmarshal.Run(req)
|
||||
if req.Error != nil {
|
||||
t.Errorf("expect not error, got %v", req.Error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user