// Unmarshal unmarshals the REST component of a response in a REST service. func Unmarshal(r *aws.Request) { if r.DataFilled() { v := reflect.Indirect(reflect.ValueOf(r.Data)) unmarshalBody(r, v) unmarshalLocationElements(r, v) } }
// Unmarshal unmarshals a response for a JSON RPC service. func Unmarshal(req *aws.Request) { defer req.HTTPResponse.Body.Close() if req.DataFilled() { err := jsonutil.UnmarshalJSON(req.Data, req.HTTPResponse.Body) if err != nil { req.Error = apierr.New("Unmarshal", "failed decoding JSON RPC response", err) } } return }
// Unmarshal unmarshals a response body for the EC2 protocol. 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, "") if err != nil { r.Error = apierr.New("Unmarshal", "failed decoding EC2 Query response", err) return } } }
func buildGetBucketLocation(r *aws.Request) { if r.DataFilled() { out := r.Data.(*GetBucketLocationOutput) b, err := ioutil.ReadAll(r.HTTPResponse.Body) if err != nil { r.Error = apierr.New("Unmarshal", "failed reading response body", err) return } match := reBucketLocation.FindSubmatch(b) if len(match) > 1 { loc := string(match[1]) out.LocationConstraint = &loc } } }