// UnmarshalMeta unmarshals the REST metadata of a response in a REST service
773876
func UnmarshalMeta(r *request.Request) {
	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")
	}
	if r.DataFilled() {
		v := reflect.Indirect(reflect.ValueOf(r.Data))
		unmarshalLocationElements(r, v)
	}
}
659747
func (k *KeyringMemberRevocationType) UnmarshalText(b []byte) error {
	switch string(b) {
	case "org_removal":
		*k = OrgRemovalRevocationType
	case "key_revocation":
		*k = KeyRevocationRevocationType
	case "machine_destroy":
		*k = MachineDestroyRevocationType
	case "machine_token_destroy":
		*k = MachineTokenDestroyRevocationType
	default:
		return errBadRevocationType
	}

	return nil
}
1111423
func (d Decoder) UnmarshalFileToMap(fs afero.Fs, filename string) (map[string]interface{}, error) {
	format := FormatFromString(filename)
	if format == "" {
		return nil, errors.Errorf("%q is not a valid configuration format", filename)
	}

	data, err := afero.ReadFile(fs, filename)
	if err != nil {
		return nil, err
	}
	return d.UnmarshalToMap(data, format)
}
1218436
func (x *Questionnaire) UnmarshalJSON(data []byte) (err error) {
	x2 := questionnaire{}
	if err = json.Unmarshal(data, &x2); err == nil {
		if x2.Contained != nil {
			for i := range x2.Contained {
				x2.Contained[i] = MapToResource(x2.Contained[i], true)
			}
		}
		*x = Questionnaire(x2)
		return x.checkResourceType()
	}
	return
}
338703
func (n *Node) UnmarshalText(text []byte) error {
	dec, err := ParseV4(string(text))
	if err == nil {
		*n = *dec
	}
	return err
}
1126311
func (c *MutableTLSCreds) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {
	return nil, nil
}
1323856
func (m Map) UnmarshalText(text []byte) error {
	err := json.Unmarshal(text, &m)
	if err != nil {
		return errors.WithStack(err)
	}
	return nil
}
1149914
func UnmarshalError(r *request.Request) {
	defer r.HTTPResponse.Body.Close()

	bodyBytes, err := ioutil.ReadAll(r.HTTPResponse.Body)
	if err != nil {
		r.Error = awserr.NewRequestFailure(
			awserr.New("SerializationError", "failed to read from query HTTP response body", err),
			r.HTTPResponse.StatusCode,
			r.RequestID,
		)
		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),
			r.HTTPResponse.StatusCode,
			r.RequestID,
		)
		return
	}

	// Failed to retrieve any error message from the response body
	r.Error = awserr.NewRequestFailure(
		awserr.New("SerializationError",
			"failed to decode query XML error response", decodeErr),
		r.HTTPResponse.StatusCode,
		r.RequestID,
	)
}
311479
func (b *Uint) UnmarshalText(input []byte) error {
	var u64 Uint64
	err := u64.UnmarshalText(input)
	if u64 > Uint64(^uint(0)) || err == ErrUint64Range {
		return ErrUintRange
	} else if err != nil {
		return err
	}
	*b = Uint(u64)
	return nil
}
1233279
func (addr *DevAddr) UnmarshalText(data []byte) error {
	parsed, err := ParseDevAddr(string(data))
	if err != nil {
		return err
	}
	*addr = DevAddr(parsed)
	return nil
}
674725
func (policy *Policy) UnmarshalJSON(data []byte) error {
	// subtype to avoid recursive call to UnmarshalJSON()
	type subPolicy Policy
	var sp subPolicy
	if err := json.Unmarshal(data, &sp); err != nil {
		return err
	}

	p := Policy(sp)
	if err := p.isValid(); err != nil {
		return err
	}

	*policy = p

	return nil
}
5294
func (l *State) UnloadMetadata() {
	l.Lock()
	defer l.Unlock()
	l.metadata = make(map[string]string)
}
1108800
func UnmarshalResponseJSON(resp *http.Response, data interface{}) error {
	//bytes, err := ResponseBody(resp)
	bytes, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return err
	}
	return json.Unmarshal(bytes, data)
}
1145393
func (x *OrderResponse) UnmarshalJSON(data []byte) (err error) {
	x2 := orderResponse{}
	if err = json.Unmarshal(data, &x2); err == nil {
		if x2.Contained != nil {
			for i := range x2.Contained {
				x2.Contained[i] = MapToResource(x2.Contained[i], true)
			}
		}
		*x = OrderResponse(x2)
		return x.checkResourceType()
	}
	return
}
910450
func (b *Compatibool) UnmarshalText(t []byte) error {
	if bytes.Equal(t, []byte("1")) {
		*b = Compatibool(true)
	}
	return nil
}
1084217
func (ia *Int64Array) UnmarshalJSON(data []byte) error {
	if isNull(data) {
		ia.Valid = false
		return nil
	}
	if data == nil {
		ia.Int64Array, ia.Valid = nil, false
		return nil
	}
	ia.Valid = true
	return json.Unmarshal(data, &ia.Int64Array)
}
154898
func (a *Accelerator) UnmarshalText(b []byte) error {
	*a = strings.Split(string(b), acceleratorSeparator)
	return nil
}