mirror of
https://github.com/Luzifer/mondash.git
synced 2024-12-25 13:31:19 +00:00
30 lines
853 B
Go
30 lines
853 B
Go
|
package query
|
||
|
|
||
|
//go:generate go run ../../fixtures/protocol/generate.go ../../fixtures/protocol/output/query.json unmarshal_test.go
|
||
|
|
||
|
import (
|
||
|
"encoding/xml"
|
||
|
|
||
|
"github.com/aws/aws-sdk-go/aws"
|
||
|
"github.com/aws/aws-sdk-go/aws/awserr"
|
||
|
"github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil"
|
||
|
)
|
||
|
|
||
|
// Unmarshal unmarshals a response for an AWS Query service.
|
||
|
func Unmarshal(r *aws.Request) {
|
||
|
defer r.HTTPResponse.Body.Close()
|
||
|
if r.DataFilled() {
|
||
|
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)
|
||
|
return
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// UnmarshalMeta unmarshals header response values for an AWS Query service.
|
||
|
func UnmarshalMeta(r *aws.Request) {
|
||
|
// TODO implement unmarshaling of request IDs
|
||
|
}
|