mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
Update Go AWS SDK to the latest version
This commit is contained in:
committed by
Andrey Smirnov
parent
d08be990ef
commit
94a72b23ff
+1
-1
@@ -21,7 +21,7 @@ func Build(r *request.Request) {
|
||||
"Version": {r.ClientInfo.APIVersion},
|
||||
}
|
||||
if err := queryutil.Parse(body, r.Params, false); err != nil {
|
||||
r.Error = awserr.New("SerializationError", "failed encoding Query request", err)
|
||||
r.Error = awserr.New(request.ErrCodeSerialization, "failed encoding Query request", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
+715
-186
File diff suppressed because it is too large
Load Diff
+6
-1
@@ -233,7 +233,12 @@ func (q *queryParser) parseScalar(v url.Values, r reflect.Value, name string, ta
|
||||
v.Set(name, strconv.FormatFloat(float64(value), 'f', -1, 32))
|
||||
case time.Time:
|
||||
const ISO8601UTC = "2006-01-02T15:04:05Z"
|
||||
v.Set(name, value.UTC().Format(ISO8601UTC))
|
||||
format := tag.Get("timestampFormat")
|
||||
if len(format) == 0 {
|
||||
format = protocol.ISO8601TimeFormatName
|
||||
}
|
||||
|
||||
v.Set(name, protocol.FormatTime(format, value))
|
||||
default:
|
||||
return fmt.Errorf("unsupported value for param %s: %v (%s)", name, r.Interface(), r.Type().Name())
|
||||
}
|
||||
|
||||
+5
-1
@@ -23,7 +23,11 @@ func Unmarshal(r *request.Request) {
|
||||
decoder := xml.NewDecoder(r.HTTPResponse.Body)
|
||||
err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result")
|
||||
if err != nil {
|
||||
r.Error = awserr.New("SerializationError", "failed decoding Query response", err)
|
||||
r.Error = awserr.NewRequestFailure(
|
||||
awserr.New(request.ErrCodeSerialization, "failed decoding Query response", err),
|
||||
r.HTTPResponse.StatusCode,
|
||||
r.RequestID,
|
||||
)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
+44
-41
@@ -2,65 +2,68 @@ package query
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"io/ioutil"
|
||||
"fmt"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil"
|
||||
)
|
||||
|
||||
type xmlErrorResponse struct {
|
||||
XMLName xml.Name `xml:"ErrorResponse"`
|
||||
Code string `xml:"Error>Code"`
|
||||
Message string `xml:"Error>Message"`
|
||||
RequestID string `xml:"RequestId"`
|
||||
}
|
||||
|
||||
type xmlServiceUnavailableResponse struct {
|
||||
XMLName xml.Name `xml:"ServiceUnavailableException"`
|
||||
}
|
||||
|
||||
// UnmarshalErrorHandler is a name request handler to unmarshal request errors
|
||||
var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.query.UnmarshalError", Fn: UnmarshalError}
|
||||
|
||||
type xmlErrorResponse struct {
|
||||
Code string `xml:"Error>Code"`
|
||||
Message string `xml:"Error>Message"`
|
||||
RequestID string `xml:"RequestId"`
|
||||
}
|
||||
|
||||
type xmlResponseError struct {
|
||||
xmlErrorResponse
|
||||
}
|
||||
|
||||
func (e *xmlResponseError) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
|
||||
const svcUnavailableTagName = "ServiceUnavailableException"
|
||||
const errorResponseTagName = "ErrorResponse"
|
||||
|
||||
switch start.Name.Local {
|
||||
case svcUnavailableTagName:
|
||||
e.Code = svcUnavailableTagName
|
||||
e.Message = "service is unavailable"
|
||||
return d.Skip()
|
||||
|
||||
case errorResponseTagName:
|
||||
return d.DecodeElement(&e.xmlErrorResponse, &start)
|
||||
|
||||
default:
|
||||
return fmt.Errorf("unknown error response tag, %v", start)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalError unmarshals an error response for an AWS Query service.
|
||||
func UnmarshalError(r *request.Request) {
|
||||
defer r.HTTPResponse.Body.Close()
|
||||
|
||||
bodyBytes, err := ioutil.ReadAll(r.HTTPResponse.Body)
|
||||
var respErr xmlResponseError
|
||||
err := xmlutil.UnmarshalXMLError(&respErr, r.HTTPResponse.Body)
|
||||
if err != nil {
|
||||
r.Error = awserr.New("SerializationError", "failed to read from query HTTP response body", err)
|
||||
return
|
||||
}
|
||||
|
||||
// First check for specific error
|
||||
resp := xmlErrorResponse{}
|
||||
decodeErr := xml.Unmarshal(bodyBytes, &resp)
|
||||
if decodeErr == nil {
|
||||
reqID := resp.RequestID
|
||||
if reqID == "" {
|
||||
reqID = r.RequestID
|
||||
}
|
||||
r.Error = awserr.NewRequestFailure(
|
||||
awserr.New(resp.Code, resp.Message, nil),
|
||||
r.HTTPResponse.StatusCode,
|
||||
reqID,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
// Check for unhandled error
|
||||
servUnavailResp := xmlServiceUnavailableResponse{}
|
||||
unavailErr := xml.Unmarshal(bodyBytes, &servUnavailResp)
|
||||
if unavailErr == nil {
|
||||
r.Error = awserr.NewRequestFailure(
|
||||
awserr.New("ServiceUnavailableException", "service is unavailable", nil),
|
||||
awserr.New(request.ErrCodeSerialization,
|
||||
"failed to unmarshal error message", err),
|
||||
r.HTTPResponse.StatusCode,
|
||||
r.RequestID,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
// Failed to retrieve any error message from the response body
|
||||
r.Error = awserr.New("SerializationError",
|
||||
"failed to decode query XML error response", decodeErr)
|
||||
reqID := respErr.RequestID
|
||||
if len(reqID) == 0 {
|
||||
reqID = r.RequestID
|
||||
}
|
||||
|
||||
r.Error = awserr.NewRequestFailure(
|
||||
awserr.New(respErr.Code, respErr.Message, nil),
|
||||
r.HTTPResponse.StatusCode,
|
||||
reqID,
|
||||
)
|
||||
}
|
||||
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
// +build go1.8
|
||||
|
||||
package query
|
||||
|
||||
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(
|
||||
`<ErrorResponse>
|
||||
<Error>
|
||||
<Code>codeAbc</Code><Message>msg123</Message>
|
||||
</Error>
|
||||
<RequestId>reqID123</RequestId>
|
||||
</ErrorResponse>`)),
|
||||
},
|
||||
},
|
||||
Code: "codeAbc", Msg: "msg123",
|
||||
Status: 400, ReqID: "reqID123",
|
||||
},
|
||||
"ServiceUnavailableException": {
|
||||
Request: &request.Request{
|
||||
HTTPResponse: &http.Response{
|
||||
StatusCode: 502,
|
||||
Header: http.Header{},
|
||||
Body: ioutil.NopCloser(strings.NewReader(
|
||||
`<ServiceUnavailableException>
|
||||
<Something>else</Something>
|
||||
</ServiceUnavailableException>`)),
|
||||
},
|
||||
},
|
||||
Code: "ServiceUnavailableException",
|
||||
Msg: "service is unavailable",
|
||||
Status: 502,
|
||||
},
|
||||
"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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
+315
-73
@@ -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.
|
||||
@@ -192,7 +193,7 @@ type OutputService1TestShapeOutputService1TestCaseOperation1Output struct {
|
||||
|
||||
Str *string `type:"string"`
|
||||
|
||||
Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
|
||||
Timestamp *time.Time `type:"timestamp"`
|
||||
|
||||
TrueBool *bool `type:"boolean"`
|
||||
}
|
||||
@@ -282,7 +283,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,
|
||||
@@ -315,7 +317,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.
|
||||
@@ -433,7 +435,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,
|
||||
@@ -466,7 +469,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.
|
||||
@@ -577,7 +580,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,
|
||||
@@ -610,7 +614,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.
|
||||
@@ -720,7 +724,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,
|
||||
@@ -753,7 +758,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.
|
||||
@@ -863,7 +868,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,
|
||||
@@ -896,7 +902,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.
|
||||
@@ -1006,7 +1012,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,
|
||||
@@ -1039,7 +1046,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.
|
||||
@@ -1149,7 +1156,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,
|
||||
@@ -1182,7 +1190,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.
|
||||
@@ -1320,7 +1328,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,
|
||||
@@ -1353,7 +1362,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.
|
||||
@@ -1491,7 +1500,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,
|
||||
@@ -1524,7 +1534,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.
|
||||
@@ -1634,7 +1644,8 @@ func newOutputService11ProtocolTestClient(cfg aws.Config, handlers request.Handl
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice11protocoltest",
|
||||
ServiceName: "OutputService11ProtocolTest",
|
||||
ServiceID: "OutputService11ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -1667,7 +1678,7 @@ 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
|
||||
// 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.
|
||||
@@ -1789,7 +1800,8 @@ func newOutputService12ProtocolTestClient(cfg aws.Config, handlers request.Handl
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice12protocoltest",
|
||||
ServiceName: "OutputService12ProtocolTest",
|
||||
ServiceID: "OutputService12ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -1822,7 +1834,7 @@ const opOutputService12TestCaseOperation1 = "OperationName"
|
||||
// OutputService12TestCaseOperation1Request generates a "aws/request.Request" representing the
|
||||
// client's request for the OutputService12TestCaseOperation1 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.
|
||||
@@ -1932,7 +1944,8 @@ func newOutputService13ProtocolTestClient(cfg aws.Config, handlers request.Handl
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice13protocoltest",
|
||||
ServiceName: "OutputService13ProtocolTest",
|
||||
ServiceID: "OutputService13ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -1965,7 +1978,7 @@ 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 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.
|
||||
@@ -2075,7 +2088,8 @@ func newOutputService14ProtocolTestClient(cfg aws.Config, handlers request.Handl
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice14protocoltest",
|
||||
ServiceName: "OutputService14ProtocolTest",
|
||||
ServiceID: "OutputService14ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -2108,7 +2122,7 @@ 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 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.
|
||||
@@ -2218,7 +2232,8 @@ func newOutputService15ProtocolTestClient(cfg aws.Config, handlers request.Handl
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice15protocoltest",
|
||||
ServiceName: "OutputService15ProtocolTest",
|
||||
ServiceID: "OutputService15ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -2251,7 +2266,7 @@ const opOutputService15TestCaseOperation1 = "OperationName"
|
||||
// OutputService15TestCaseOperation1Request generates a "aws/request.Request" representing the
|
||||
// client's request for the OutputService15TestCaseOperation1 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.
|
||||
@@ -2361,7 +2376,8 @@ func newOutputService16ProtocolTestClient(cfg aws.Config, handlers request.Handl
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "outputservice16protocoltest",
|
||||
ServiceName: "OutputService16ProtocolTest",
|
||||
ServiceID: "OutputService16ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
@@ -2394,7 +2410,7 @@ const opOutputService16TestCaseOperation1 = "OperationName"
|
||||
// OutputService16TestCaseOperation1Request generates a "aws/request.Request" representing the
|
||||
// client's request for the OutputService16TestCaseOperation1 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.
|
||||
@@ -2464,28 +2480,216 @@ type OutputService16TestShapeOutputService16TestCaseOperation1Input struct {
|
||||
type OutputService16TestShapeOutputService16TestCaseOperation1Output struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
FooEnum *string `type:"string" enum:"OutputService16TestShapeEC2EnumType"`
|
||||
StructMember *OutputService16TestShapeTimeContainer `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 *OutputService16TestShapeOutputService16TestCaseOperation1Output) SetStructMember(v *OutputService16TestShapeTimeContainer) *OutputService16TestShapeOutputService16TestCaseOperation1Output {
|
||||
s.StructMember = v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetTimeArg sets the TimeArg field's value.
|
||||
func (s *OutputService16TestShapeOutputService16TestCaseOperation1Output) SetTimeArg(v time.Time) *OutputService16TestShapeOutputService16TestCaseOperation1Output {
|
||||
s.TimeArg = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetTimeCustom sets the TimeCustom field's value.
|
||||
func (s *OutputService16TestShapeOutputService16TestCaseOperation1Output) SetTimeCustom(v time.Time) *OutputService16TestShapeOutputService16TestCaseOperation1Output {
|
||||
s.TimeCustom = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetTimeFormat sets the TimeFormat field's value.
|
||||
func (s *OutputService16TestShapeOutputService16TestCaseOperation1Output) SetTimeFormat(v time.Time) *OutputService16TestShapeOutputService16TestCaseOperation1Output {
|
||||
s.TimeFormat = &v
|
||||
return s
|
||||
}
|
||||
|
||||
type OutputService16TestShapeTimeContainer 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 *OutputService16TestShapeTimeContainer) SetBar(v time.Time) *OutputService16TestShapeTimeContainer {
|
||||
s.Bar = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetFoo sets the Foo field's value.
|
||||
func (s *OutputService16TestShapeTimeContainer) SetFoo(v time.Time) *OutputService16TestShapeTimeContainer {
|
||||
s.Foo = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// OutputService17ProtocolTest provides the API operation methods for making requests to
|
||||
// . See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// OutputService17ProtocolTest methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type OutputService17ProtocolTest struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
// New creates a new instance of the OutputService17ProtocolTest 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 OutputService17ProtocolTest client from just a session.
|
||||
// svc := outputservice17protocoltest.New(mySession)
|
||||
//
|
||||
// // Create a OutputService17ProtocolTest client with additional configuration
|
||||
// svc := outputservice17protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func NewOutputService17ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService17ProtocolTest {
|
||||
c := p.ClientConfig("outputservice17protocoltest", cfgs...)
|
||||
return newOutputService17ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newOutputService17ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService17ProtocolTest {
|
||||
svc := &OutputService17ProtocolTest{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: "OutputService17ProtocolTest",
|
||||
ServiceID: "OutputService17ProtocolTest",
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(query.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler)
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a OutputService17ProtocolTest operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *OutputService17ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
|
||||
req := c.NewRequest(op, params, data)
|
||||
|
||||
return req
|
||||
}
|
||||
|
||||
const opOutputService17TestCaseOperation1 = "OperationName"
|
||||
|
||||
// OutputService17TestCaseOperation1Request generates a "aws/request.Request" representing the
|
||||
// client's request for the OutputService17TestCaseOperation1 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 OutputService17TestCaseOperation1 for more information on using the OutputService17TestCaseOperation1
|
||||
// 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 OutputService17TestCaseOperation1Request method.
|
||||
// req, resp := client.OutputService17TestCaseOperation1Request(params)
|
||||
//
|
||||
// err := req.Send()
|
||||
// if err == nil { // resp is now filled
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
func (c *OutputService17ProtocolTest) OutputService17TestCaseOperation1Request(input *OutputService17TestShapeOutputService17TestCaseOperation1Input) (req *request.Request, output *OutputService17TestShapeOutputService17TestCaseOperation1Output) {
|
||||
op := &request.Operation{
|
||||
Name: opOutputService17TestCaseOperation1,
|
||||
HTTPPath: "/",
|
||||
}
|
||||
|
||||
if input == nil {
|
||||
input = &OutputService17TestShapeOutputService17TestCaseOperation1Input{}
|
||||
}
|
||||
|
||||
output = &OutputService17TestShapeOutputService17TestCaseOperation1Output{}
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
// OutputService17TestCaseOperation1 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 OutputService17TestCaseOperation1 for usage and error information.
|
||||
func (c *OutputService17ProtocolTest) OutputService17TestCaseOperation1(input *OutputService17TestShapeOutputService17TestCaseOperation1Input) (*OutputService17TestShapeOutputService17TestCaseOperation1Output, error) {
|
||||
req, out := c.OutputService17TestCaseOperation1Request(input)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// OutputService17TestCaseOperation1WithContext is the same as OutputService17TestCaseOperation1 with the addition of
|
||||
// the ability to pass a context and additional request options.
|
||||
//
|
||||
// See OutputService17TestCaseOperation1 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 *OutputService17ProtocolTest) OutputService17TestCaseOperation1WithContext(ctx aws.Context, input *OutputService17TestShapeOutputService17TestCaseOperation1Input, opts ...request.Option) (*OutputService17TestShapeOutputService17TestCaseOperation1Output, error) {
|
||||
req, out := c.OutputService17TestCaseOperation1Request(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
type OutputService17TestShapeOutputService17TestCaseOperation1Input struct {
|
||||
_ struct{} `type:"structure"`
|
||||
}
|
||||
|
||||
type OutputService17TestShapeOutputService17TestCaseOperation1Output struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
FooEnum *string `type:"string" enum:"OutputService17TestShapeEC2EnumType"`
|
||||
|
||||
ListEnums []*string `type:"list"`
|
||||
}
|
||||
|
||||
// SetFooEnum sets the FooEnum field's value.
|
||||
func (s *OutputService16TestShapeOutputService16TestCaseOperation1Output) SetFooEnum(v string) *OutputService16TestShapeOutputService16TestCaseOperation1Output {
|
||||
func (s *OutputService17TestShapeOutputService17TestCaseOperation1Output) SetFooEnum(v string) *OutputService17TestShapeOutputService17TestCaseOperation1Output {
|
||||
s.FooEnum = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetListEnums sets the ListEnums field's value.
|
||||
func (s *OutputService16TestShapeOutputService16TestCaseOperation1Output) SetListEnums(v []*string) *OutputService16TestShapeOutputService16TestCaseOperation1Output {
|
||||
func (s *OutputService17TestShapeOutputService17TestCaseOperation1Output) SetListEnums(v []*string) *OutputService17TestShapeOutputService17TestCaseOperation1Output {
|
||||
s.ListEnums = v
|
||||
return s
|
||||
}
|
||||
|
||||
const (
|
||||
// EC2EnumTypeFoo is a OutputService16TestShapeEC2EnumType enum value
|
||||
// EC2EnumTypeFoo is a OutputService17TestShapeEC2EnumType enum value
|
||||
EC2EnumTypeFoo = "foo"
|
||||
|
||||
// EC2EnumTypeBar is a OutputService16TestShapeEC2EnumType enum value
|
||||
// EC2EnumTypeBar is a OutputService17TestShapeEC2EnumType enum value
|
||||
EC2EnumTypeBar = "bar"
|
||||
)
|
||||
|
||||
@@ -2503,8 +2707,8 @@ func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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)
|
||||
}
|
||||
@@ -2534,7 +2738,7 @@ func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) {
|
||||
if e, a := "myname", *out.Str; e != a {
|
||||
t.Errorf("expect %v, got %v", e, a)
|
||||
}
|
||||
if e, a := time.Unix(1.4221728e+09, 0).UTC().String(), out.Timestamp.String(); e != a {
|
||||
if e, a := time.Unix(1.4221728e+09, 0).UTC().String(), out.Timestamp.UTC().String(); e != a {
|
||||
t.Errorf("expect %v, got %v", e, a)
|
||||
}
|
||||
if e, a := true, *out.TrueBool; e != a {
|
||||
@@ -2553,8 +2757,8 @@ func TestOutputService2ProtocolTestNotAllMembersInResponseCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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)
|
||||
}
|
||||
@@ -2579,8 +2783,8 @@ func TestOutputService3ProtocolTestBlobCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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)
|
||||
}
|
||||
@@ -2605,8 +2809,8 @@ func TestOutputService4ProtocolTestListsCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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)
|
||||
}
|
||||
@@ -2634,8 +2838,8 @@ func TestOutputService5ProtocolTestListWithCustomMemberNameCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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)
|
||||
}
|
||||
@@ -2663,8 +2867,8 @@ func TestOutputService6ProtocolTestFlattenedListCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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)
|
||||
}
|
||||
@@ -2692,8 +2896,8 @@ func TestOutputService7ProtocolTestFlattenedSingleElementListCase1(t *testing.T)
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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)
|
||||
}
|
||||
@@ -2718,8 +2922,8 @@ func TestOutputService8ProtocolTestListOfStructuresCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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)
|
||||
}
|
||||
@@ -2759,8 +2963,8 @@ func TestOutputService9ProtocolTestFlattenedListOfStructuresCase1(t *testing.T)
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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)
|
||||
}
|
||||
@@ -2800,8 +3004,8 @@ func TestOutputService10ProtocolTestFlattenedListWithLocationNameCase1(t *testin
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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)
|
||||
}
|
||||
@@ -2829,8 +3033,8 @@ func TestOutputService11ProtocolTestNormalMapCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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)
|
||||
}
|
||||
@@ -2858,8 +3062,8 @@ func TestOutputService12ProtocolTestFlattenedMapCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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)
|
||||
}
|
||||
@@ -2887,8 +3091,8 @@ func TestOutputService13ProtocolTestFlattenedMapInShapeDefinitionCase1(t *testin
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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)
|
||||
}
|
||||
@@ -2913,8 +3117,8 @@ func TestOutputService14ProtocolTestNamedMapCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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)
|
||||
}
|
||||
@@ -2942,8 +3146,8 @@ func TestOutputService15ProtocolTestEmptyStringCase1(t *testing.T) {
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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)
|
||||
}
|
||||
@@ -2958,18 +3162,56 @@ func TestOutputService15ProtocolTestEmptyStringCase1(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
func TestOutputService16ProtocolTestEnumOutputCase1(t *testing.T) {
|
||||
func TestOutputService16ProtocolTestTimestampMembersCase1(t *testing.T) {
|
||||
svc := NewOutputService16ProtocolTest(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.OutputService16TestCaseOperation1Request(nil)
|
||||
req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
|
||||
|
||||
// set headers
|
||||
|
||||
// unmarshal response
|
||||
query.UnmarshalMeta(req)
|
||||
query.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 TestOutputService17ProtocolTestEnumOutputCase1(t *testing.T) {
|
||||
svc := NewOutputService17ProtocolTest(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.OutputService17TestCaseOperation1Request(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