func (metadata *GooglePhotoMetadata) UnmarshalJSON(b []byte) error {

	var f interface{}
	json.Unmarshal(b, &f)

	allProps := f.(map[string]interface{})
	photoTakenTimeMap := allProps["photoTakenTime"]
	if photoTakenTimeMap != nil {
		photoTakenTimeProps := photoTakenTimeMap.(map[string]interface{})
		unixTimeString := photoTakenTimeProps["timestamp"].(string)
		if unixTimeString != "" {
			unixTimeInt64, err := strconv.ParseInt(unixTimeString, 10, 64)
			if err == nil {
				metadata.PhotoTakenTime = time.Unix(unixTimeInt64, 0)
			}
		}
	}

	isTrashed := allProps["trashed"]
	if isTrashed != nil {
		metadata.IsTrashed = isTrashed.(bool)
	}

	return nil
}
// UnmarshalJSON unmarshalls the Google Metadata format into the values of interest.
UnmarshalJSON unmarshalls the Google Metadata format into the values of interest.
// UnmarshalJSON unmarshalls the Google Metadata format into the values of interest .
func (metadata *GooglePhotoMetadata) UnmarshalJSON(b []byte) error {
	var f interface{}
	json.Unmarshal(b, &f)
	allProps := f.(map[string]interface{})
	photoTakenTimeMap := allProps["photoTakenTime"]
	if photoTakenTimeMap != nil {
		photoTakenTimeProps := photoTakenTimeMap.(map[string]interface{})
		unixTimeString := photoTakenTimeProps["timestamp"].(string)
		if unixTimeString != "" {
			unixTimeInt64, err := strconv.ParseInt(unixTimeString, 10, 64)
			if err == nil {
				metadata.PhotoTakenTime = time.Unix(unixTimeInt64, 0)
			}
		}
	}
	isTrashed := allProps["trashed"]
	if isTrashed != nil {
		metadata.IsTrashed = isTrashed.(bool)
	}
	return nil
}
func ( metadata * GooglePhotoMetadata ) UnmarshalJSON ( b [ ] byte ) error { var f interface { } json . Unmarshal ( b , & f ) allProps := f . ( map [ string ] interface { } ) photoTakenTimeMap := allProps [ " " ] if photoTakenTimeMap != nil { photoTakenTimeProps := photoTakenTimeMap . ( map [ string ] interface { } ) unixTimeString := photoTakenTimeProps [ " " ] . ( string ) if unixTimeString != " " { unixTimeInt64 , err := strconv . ParseInt ( unixTimeString , 10 , 64 ) if err == nil { metadata . PhotoTakenTime = time . Unix ( unixTimeInt64 , 0 ) } } } isTrashed := allProps [ " " ] if isTrashed != nil { metadata . IsTrashed = isTrashed . ( bool ) } return nil }
UnmarshalJSON unmarshalls the Google Metadata format into the values of interest.
UnmarshalJSON unmarshalls the Google Metadata format into the values of interest .