// UnmarshalJSON implements the json unmarshal to be used by the json-library
UnmarshalJSON implements the json unmarshal to be used by the json-library
// UnmarshalJSON implements the json unmarshal to be used by the json - library
func (g *Signin) UnmarshalJSON(data []byte) error {
	tmp := struct {
		ID                       	string   `json:"id"`
		UserPrincipalName       	string   `json:"userPrincipalName"`
		UserDisplayName         	string   `json:"userDisplayName"`
		CreatedDateTime         	string   `json:"createdDateTime"`
		AppDisplayName          	string   `json:"appDisplayName"`
		IpAddress                	string   `json:"ipAddress"`
		ClientAppUsed				string 	 `json:"clientAppUsed"`
		ResourceDisplayName			string 	 `json:"resourceDisplayName"`
		DeviceDetail				DeviceDetail `json:"deviceDetail"`
		Location					Location	`json:"location"`
		GeoCoordinates					GeoCoordinates	`json:"geoCoordinates"`
		Status Status `json:"status"`
	}{}
	err := json.Unmarshal(data, &tmp)
	if err != nil {
		return err
	}
	g.ID = tmp.ID
	g.UserPrincipalName = tmp.UserPrincipalName
	g.UserDisplayName = tmp.UserDisplayName
	g.CreatedDateTime, err = time.Parse(time.RFC3339, tmp.CreatedDateTime)
	if err != nil && tmp.CreatedDateTime != "" {
		return fmt.Errorf("Can not parse CreatedDateTime %v with RFC3339: %v", tmp.CreatedDateTime, err)
	}
	g.AppDisplayName = tmp.AppDisplayName
	g.IpAddress = tmp.IpAddress
	g.ClientAppUsed = tmp.ClientAppUsed
	g.ResourceDisplayName = tmp.ResourceDisplayName
	g.DeviceDetail = tmp.DeviceDetail
	g.Location = tmp.Location
	g.Status = tmp.Status
	return nil
}
func ( g * Signin ) UnmarshalJSON ( data [ ] byte ) error { tmp := struct { ID string `json:"id"` UserPrincipalName string `json:"userPrincipalName"` UserDisplayName string `json:"userDisplayName"` CreatedDateTime string `json:"createdDateTime"` AppDisplayName string `json:"appDisplayName"` IpAddress string `json:"ipAddress"` ClientAppUsed string `json:"clientAppUsed"` ResourceDisplayName string `json:"resourceDisplayName"` DeviceDetail DeviceDetail `json:"deviceDetail"` Location Location `json:"location"` GeoCoordinates GeoCoordinates `json:"geoCoordinates"` Status Status `json:"status"` } { } err := json . Unmarshal ( data , & tmp ) if err != nil { return err } g . ID = tmp . ID g . UserPrincipalName = tmp . UserPrincipalName g . UserDisplayName = tmp . UserDisplayName g . CreatedDateTime , err = time . Parse ( time . RFC3339 , tmp . CreatedDateTime ) if err != nil && tmp . CreatedDateTime != " " { return fmt . Errorf ( " " , tmp . CreatedDateTime , err ) } g . AppDisplayName = tmp . AppDisplayName g . IpAddress = tmp . IpAddress g . ClientAppUsed = tmp . ClientAppUsed g . ResourceDisplayName = tmp . ResourceDisplayName g . DeviceDetail = tmp . DeviceDetail g . Location = tmp . Location g . Status = tmp . Status return nil }
UnmarshalJSON implements the json unmarshal to be used by the json-library
UnmarshalJSON implements the json unmarshal to be used by the json - library