/* tslint:disable */
/* eslint-disable */
/**
* Gravatar Public API
* Gravatar\'s public API endpoints
*
* The version of the OpenAPI document: 3.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime.js';
/**
* An avatar that the user has already uploaded to their Gravatar account.
* @export
* @interface Avatar
*/
export interface Avatar {
/**
* Unique identifier for the image.
* @type {string}
* @memberof Avatar
*/
imageId: string;
/**
* Image URL
* @type {string}
* @memberof Avatar
*/
imageUrl: string;
/**
* Rating associated with the image.
* @type {string}
* @memberof Avatar
*/
rating: AvatarRatingEnum;
/**
* Alternative text description of the image.
* @type {string}
* @memberof Avatar
*/
altText: string;
/**
* Whether the image is currently selected as the provided selected email's avatar.
* @type {boolean}
* @memberof Avatar
*/
selected?: boolean;
/**
* Date and time when the image was last updated.
* @type {Date}
* @memberof Avatar
*/
updatedDate: Date;
}
/**
* @export
*/
export const AvatarRatingEnum = {
G: 'G',
Pg: 'PG',
R: 'R',
X: 'X'
} as const;
export type AvatarRatingEnum = typeof AvatarRatingEnum[keyof typeof AvatarRatingEnum];
/**
* Check if a given object implements the Avatar interface.
*/
export function instanceOfAvatar(value: object): value is Avatar {
if (!('imageId' in value) || value['imageId'] === undefined) return false;
if (!('imageUrl' in value) || value['imageUrl'] === undefined) return false;
if (!('rating' in value) || value['rating'] === undefined) return false;
if (!('altText' in value) || value['altText'] === undefined) return false;
if (!('updatedDate' in value) || value['updatedDate'] === undefined) return false;
return true;
}
export function AvatarFromJSON(json: any): Avatar {
return AvatarFromJSONTyped(json, false);
}
export function AvatarFromJSONTyped(json: any, ignoreDiscriminator: boolean): Avatar {
if (json == null) {
return json;
}
return {
'imageId': json['image_id'],
'imageUrl': json['image_url'],
'rating': json['rating'],
'altText': json['alt_text'],
'selected': json['selected'] == null ? undefined : json['selected'],
'updatedDate': (new Date(json['updated_date'])),
};
}
export function AvatarToJSON(json: any): Avatar {
return AvatarToJSONTyped(json, false);
}
export function AvatarToJSONTyped(value?: Avatar | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'image_id': value['imageId'],
'image_url': value['imageUrl'],
'rating': value['rating'],
'alt_text': value['altText'],
'selected': value['selected'],
'updated_date': ((value['updatedDate']).toISOString()),
};
}