func (t *Token) UnmarshalJSON(data []byte) error {
	var res struct {
		Data struct {
			Token struct {
				oauth2.Token
				RefreshTokenExpiresIn int64 `json:"refresh_token_expires_in,omitempty"`
				TokenExpiresIn        int64 `json:"token_expires_in,omitempty"`
			}
		}
	}

	err := json.Unmarshal(data, &res)
	if err == nil {
		(*t) = (Token)(res.Data.Token.Token)

		if res.Data.Token.Expiry.IsZero() && res.Data.Token.TokenExpiresIn != 0 {
			t.Expiry = time.Unix(res.Data.Token.TokenExpiresIn, 0)
		}
	}

	return err
}
// UnmarshalJSON decodes the token api response
UnmarshalJSON decodes the token api response
// UnmarshalJSON decodes the token api response
func (t *Token) UnmarshalJSON(data []byte) error {
	var res struct {
		Data struct {
			Token struct {
				oauth2.Token
				RefreshTokenExpiresIn int64 `json:"refresh_token_expires_in,omitempty"`
				TokenExpiresIn        int64 `json:"token_expires_in,omitempty"`
			}
		}
	}
	err := json.Unmarshal(data, &res)
	if err == nil {
		(*t) = (Token)(res.Data.Token.Token)
		if res.Data.Token.Expiry.IsZero() && res.Data.Token.TokenExpiresIn != 0 {
			t.Expiry = time.Unix(res.Data.Token.TokenExpiresIn, 0)
		}
	}
	return err
}
func ( t * Token ) UnmarshalJSON ( data [ ] byte ) error { var res struct { Data struct { Token struct { oauth2 . Token RefreshTokenExpiresIn int64 `json:"refresh_token_expires_in,omitempty"` TokenExpiresIn int64 `json:"token_expires_in,omitempty"` } } } err := json . Unmarshal ( data , & res ) if err == nil { ( * t ) = ( Token ) ( res . Data . Token . Token ) if res . Data . Token . Expiry . IsZero ( ) && res . Data . Token . TokenExpiresIn != 0 { t . Expiry = time . Unix ( res . Data . Token . TokenExpiresIn , 0 ) } } return err }
UnmarshalJSON decodes the token api response
UnmarshalJSON decodes the token api response