// UnmarshalJSON handles deserialization of a WebhookEndpoint.
// This custom unmarshaling is needed because the resulting
// property may be an id or the full struct if it was expanded.
354169
func (c *WebhookEndpoint) UnmarshalJSON(data []byte) error {
	if id, ok := ParseID(data); ok {
		c.ID = id
		return nil
	}

	type endpoint WebhookEndpoint
	var v endpoint
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}

	*c = WebhookEndpoint(v)
	return nil
}
842496
func (v *LargePayload) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonCfe4e5f0DecodeGithubComFrancoispqtGojayBenchmarks(&r, v)
	return r.Error()
}
1217822
func (l *Line) UnmarshalJSON(data []byte) error {
	var points [][2]float64

	err := json.Unmarshal(data, &points)
	if err != nil {
		return err
	}

	if len(points) > 2 {
		return errors.New("geo: too many points to unmarshal into line")
	}

	if len(points) < 2 {
		return errors.New("geo: not enough points to unmarshal into line")
	}

	l.a = Point{points[0][0], points[0][1]}
	l.b = Point{points[1][0], points[1][1]}

	return nil
}
564864
func (c *Connector) UnmarshalJSON(b []byte) error {
	var conn struct {
		Type string `json:"type"`
		Name string `json:"name"`
		ID   string `json:"id"`

		Config json.RawMessage `json:"config"`
	}
	if err := json.Unmarshal(b, &conn); err != nil {
		return fmt.Errorf("parse connector: %v", err)
	}
	f, ok := server.ConnectorsConfig[conn.Type]
	if !ok {
		return fmt.Errorf("unknown connector type %q", conn.Type)
	}

	connConfig := f()
	if len(conn.Config) != 0 {
		data := []byte(os.ExpandEnv(string(conn.Config)))
		if err := json.Unmarshal(data, connConfig); err != nil {
			return fmt.Errorf("parse connector config: %v", err)
		}
	}
	*c = Connector{
		Type:   conn.Type,
		Name:   conn.Name,
		ID:     conn.ID,
		Config: connConfig,
	}
	return nil
}
1049878
func (s *SourceNetwork) UnmarshalJSON(data []byte) error {
	// SourceNetworkが未設定の場合、APIレスポンスが""となるため回避する
	if string(data) == `""` {
		return nil
	}

	tmp := []string{}
	if err := json.Unmarshal(data, &tmp); err != nil {
		return err
	}
	source := SourceNetwork(tmp)
	*s = source
	return nil
}
389442
func (e *EphemeralKey) UnmarshalJSON(data []byte) error {
	type ephemeralKey EphemeralKey
	var ee ephemeralKey
	err := json.Unmarshal(data, &ee)
	if err == nil {
		*e = EphemeralKey(ee)
	}

	e.RawJSON = data

	return nil
}
453294
func (resp *OpenIDTokenResponse) UnmarshalJSON(data []byte) (err error) {
	o2 := openIDTokenResponse{}
	if err = json.Unmarshal(data, &o2); err == nil {
		*resp = OpenIDTokenResponse(o2)
		now := time.Now()
		resp.Expiration = now.Add(time.Duration(resp.ExpiresIn) * time.Second)
		return
	}
	return
}
592022
func (self *StructFieldDef) UnmarshalJSON(b []byte) error {
	var m rawStructFieldDef
	err := json.Unmarshal(b, &m)
	if err == nil {
		o := StructFieldDef(m)
		*self = o
		err = self.Validate()
	}
	return err
}
1369202
func (m *JsonHelperScannable) UnmarshalJSON(data []byte) error {
	if m == nil {
		return errors.New("JsonHelperScannable must not be nil")
	}
	jh := make(u.JsonHelper)
	if err := json.Unmarshal(data, &jh); err != nil {
		return err
	}
	*m = JsonHelperScannable(jh)
	return nil
}
1001955
func (id *RequestID) UnmarshalJSON(b []byte) error {
	id.intError = json.Unmarshal(b, &id.intValue)
	id.floatError = json.Unmarshal(b, &id.floatValue)
	id.stringError = json.Unmarshal(b, &id.stringValue)

	return nil
}
475296
func (l *APIGatewayMethodIntegrationResponseList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := APIGatewayMethodIntegrationResponse{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = APIGatewayMethodIntegrationResponseList{item}
		return nil
	}
	list := []APIGatewayMethodIntegrationResponse{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = APIGatewayMethodIntegrationResponseList(list)
		return nil
	}
	return err
}
978038
func (v *ClientInfo) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents8(&r, v)
	return r.Error()
}
245280
func (e *httpError) UnmarshalJSON(data []byte) error {
	e.goof = newGoof("", nil)
	if err := e.goof.UnmarshalJSON(data); err != nil {
		return err
	}
	if v, ok := e.data["status"].(float64); ok {
		e.data["status"] = int(v)
	}
	return nil
}
1359425
func (h *Handle) UnmarshalJSON(data []byte) error {
	var (
		m   map[string]interface{}
		b   []byte
		err error
	)
	if err = json.Unmarshal(data, &m); err != nil {
		return err
	}
	h.id = m["id"].(string)
	bi, _ := json.Marshal(m["sequence"])
	if err := json.Unmarshal(bi, &b); err != nil {
		return err
	}
	return h.FromByteArray(b)
}
677034
func (v *Annotation) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat3(&r, v)
	return r.Error()
}
1374667
func (self *ExceptionDef) UnmarshalJSON(b []byte) error {
	var m rawExceptionDef
	err := json.Unmarshal(b, &m)
	if err == nil {
		o := ExceptionDef(m)
		*self = o
		err = self.Validate()
	}
	return err
}
282199
func (r *rawBase64) UnmarshalJSON(b []byte) error {
	if len(b) > 1 && b[0] == '"' && b[len(b)-1] == '"' {
		b = b[1 : len(b)-1]
	}
	*r = rawBase64(b)
	return nil
}