/* 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';
import type { Interest } from './Interest.js';
import {
InterestFromJSON,
InterestFromJSONTyped,
InterestToJSON,
InterestToJSONTyped,
} from './Interest.js';
import type { Language } from './Language.js';
import {
LanguageFromJSON,
LanguageFromJSONTyped,
LanguageToJSON,
LanguageToJSONTyped,
} from './Language.js';
import type { ProfileContactInfo } from './ProfileContactInfo.js';
import {
ProfileContactInfoFromJSON,
ProfileContactInfoFromJSONTyped,
ProfileContactInfoToJSON,
ProfileContactInfoToJSONTyped,
} from './ProfileContactInfo.js';
import type { VerifiedAccount } from './VerifiedAccount.js';
import {
VerifiedAccountFromJSON,
VerifiedAccountFromJSONTyped,
VerifiedAccountToJSON,
VerifiedAccountToJSONTyped,
} from './VerifiedAccount.js';
import type { Link } from './Link.js';
import {
LinkFromJSON,
LinkFromJSONTyped,
LinkToJSON,
LinkToJSONTyped,
} from './Link.js';
import type { GalleryImage } from './GalleryImage.js';
import {
GalleryImageFromJSON,
GalleryImageFromJSONTyped,
GalleryImageToJSON,
GalleryImageToJSONTyped,
} from './GalleryImage.js';
import type { ProfilePayments } from './ProfilePayments.js';
import {
ProfilePaymentsFromJSON,
ProfilePaymentsFromJSONTyped,
ProfilePaymentsToJSON,
ProfilePaymentsToJSONTyped,
} from './ProfilePayments.js';
/**
* A user's profile information.
* @export
* @interface Profile
*/
export interface Profile {
/**
* The SHA256 hash of the user's primary email address.
* @type {string}
* @memberof Profile
*/
hash: string;
/**
* The user's display name. This is the name that is displayed on their profile.
* @type {string}
* @memberof Profile
*/
displayName: string;
/**
* The full URL for the user's profile.
* @type {string}
* @memberof Profile
*/
profileUrl: string;
/**
* The URL for the user's avatar image if it has been set.
* @type {string}
* @memberof Profile
*/
avatarUrl: string;
/**
* The alt text for the user's avatar image if it has been set.
* @type {string}
* @memberof Profile
*/
avatarAltText: string;
/**
* The user's location.
* @type {string}
* @memberof Profile
*/
location: string;
/**
* The about section on a user's profile.
* @type {string}
* @memberof Profile
*/
description: string;
/**
* The user's job title.
* @type {string}
* @memberof Profile
*/
jobTitle: string;
/**
* The user's current company's name.
* @type {string}
* @memberof Profile
*/
company: string;
/**
* A list of verified accounts the user has added to their profile. This is limited to a max of 4 in unauthenticated requests.
* @type {Array<VerifiedAccount>}
* @memberof Profile
*/
verifiedAccounts: Array<VerifiedAccount>;
/**
* The phonetic pronunciation of the user's name.
* @type {string}
* @memberof Profile
*/
pronunciation: string;
/**
* The pronouns the user uses.
* @type {string}
* @memberof Profile
*/
pronouns: string;
/**
* The timezone the user has. This is only provided in authenticated API requests.
* @type {string}
* @memberof Profile
*/
timezone?: string;
/**
* The languages the user knows. This is only provided in authenticated API requests.
* @type {Array<Language>}
* @memberof Profile
*/
languages?: Array<Language>;
/**
* User's first name. This is only provided in authenticated API requests.
* @type {string}
* @memberof Profile
*/
firstName?: string;
/**
* User's last name. This is only provided in authenticated API requests.
* @type {string}
* @memberof Profile
*/
lastName?: string;
/**
* Whether user is an organization. This is only provided in authenticated API requests.
* @type {boolean}
* @memberof Profile
*/
isOrganization?: boolean;
/**
* The header image used in the main profile card.
* @type {string}
* @memberof Profile
*/
headerImage?: string;
/**
* The profile background color.
* @type {string}
* @memberof Profile
*/
backgroundColor?: string;
/**
* A list of links the user has added to their profile. This is only provided in authenticated API requests.
* @type {Array<Link>}
* @memberof Profile
*/
links?: Array<Link>;
/**
* A list of interests the user has added to their profile. This is only provided in authenticated API requests.
* @type {Array<Interest>}
* @memberof Profile
*/
interests?: Array<Interest>;
/**
*
* @type {ProfilePayments}
* @memberof Profile
*/
payments?: ProfilePayments;
/**
*
* @type {ProfileContactInfo}
* @memberof Profile
*/
contactInfo?: ProfileContactInfo;
/**
* Additional images a user has uploaded. This is only provided in authenticated API requests.
* @type {Array<GalleryImage>}
* @memberof Profile
*/
gallery?: Array<GalleryImage>;
/**
* The number of verified accounts the user has added to their profile. This count includes verified accounts the user is hiding from their profile. This is only provided in authenticated API requests.
* @type {number}
* @memberof Profile
*/
numberVerifiedAccounts?: number;
/**
* The date and time (UTC) the user last edited their profile. This is only provided in authenticated API requests.
* @type {Date}
* @memberof Profile
*/
lastProfileEdit?: Date | null;
/**
* The date the user registered their account. This is only provided in authenticated API requests.
* @type {Date}
* @memberof Profile
*/
registrationDate?: Date | null;
}
/**
* Check if a given object implements the Profile interface.
*/
export function instanceOfProfile(value: object): value is Profile {
if (!('hash' in value) || value['hash'] === undefined) return false;
if (!('displayName' in value) || value['displayName'] === undefined) return false;
if (!('profileUrl' in value) || value['profileUrl'] === undefined) return false;
if (!('avatarUrl' in value) || value['avatarUrl'] === undefined) return false;
if (!('avatarAltText' in value) || value['avatarAltText'] === undefined) return false;
if (!('location' in value) || value['location'] === undefined) return false;
if (!('description' in value) || value['description'] === undefined) return false;
if (!('jobTitle' in value) || value['jobTitle'] === undefined) return false;
if (!('company' in value) || value['company'] === undefined) return false;
if (!('verifiedAccounts' in value) || value['verifiedAccounts'] === undefined) return false;
if (!('pronunciation' in value) || value['pronunciation'] === undefined) return false;
if (!('pronouns' in value) || value['pronouns'] === undefined) return false;
return true;
}
export function ProfileFromJSON(json: any): Profile {
return ProfileFromJSONTyped(json, false);
}
export function ProfileFromJSONTyped(json: any, ignoreDiscriminator: boolean): Profile {
if (json == null) {
return json;
}
return {
'hash': json['hash'],
'displayName': json['display_name'],
'profileUrl': json['profile_url'],
'avatarUrl': json['avatar_url'],
'avatarAltText': json['avatar_alt_text'],
'location': json['location'],
'description': json['description'],
'jobTitle': json['job_title'],
'company': json['company'],
'verifiedAccounts': ((json['verified_accounts'] as Array<any>).map(VerifiedAccountFromJSON)),
'pronunciation': json['pronunciation'],
'pronouns': json['pronouns'],
'timezone': json['timezone'] == null ? undefined : json['timezone'],
'languages': json['languages'] == null ? undefined : ((json['languages'] as Array<any>).map(LanguageFromJSON)),
'firstName': json['first_name'] == null ? undefined : json['first_name'],
'lastName': json['last_name'] == null ? undefined : json['last_name'],
'isOrganization': json['is_organization'] == null ? undefined : json['is_organization'],
'headerImage': json['header_image'] == null ? undefined : json['header_image'],
'backgroundColor': json['background_color'] == null ? undefined : json['background_color'],
'links': json['links'] == null ? undefined : ((json['links'] as Array<any>).map(LinkFromJSON)),
'interests': json['interests'] == null ? undefined : ((json['interests'] as Array<any>).map(InterestFromJSON)),
'payments': json['payments'] == null ? undefined : ProfilePaymentsFromJSON(json['payments']),
'contactInfo': json['contact_info'] == null ? undefined : ProfileContactInfoFromJSON(json['contact_info']),
'gallery': json['gallery'] == null ? undefined : ((json['gallery'] as Array<any>).map(GalleryImageFromJSON)),
'numberVerifiedAccounts': json['number_verified_accounts'] == null ? undefined : json['number_verified_accounts'],
'lastProfileEdit': json['last_profile_edit'] == null ? undefined : (new Date(json['last_profile_edit'])),
'registrationDate': json['registration_date'] == null ? undefined : (new Date(json['registration_date'])),
};
}
export function ProfileToJSON(json: any): Profile {
return ProfileToJSONTyped(json, false);
}
export function ProfileToJSONTyped(value?: Profile | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'hash': value['hash'],
'display_name': value['displayName'],
'profile_url': value['profileUrl'],
'avatar_url': value['avatarUrl'],
'avatar_alt_text': value['avatarAltText'],
'location': value['location'],
'description': value['description'],
'job_title': value['jobTitle'],
'company': value['company'],
'verified_accounts': ((value['verifiedAccounts'] as Array<any>).map(VerifiedAccountToJSON)),
'pronunciation': value['pronunciation'],
'pronouns': value['pronouns'],
'timezone': value['timezone'],
'languages': value['languages'] == null ? undefined : ((value['languages'] as Array<any>).map(LanguageToJSON)),
'first_name': value['firstName'],
'last_name': value['lastName'],
'is_organization': value['isOrganization'],
'header_image': value['headerImage'],
'background_color': value['backgroundColor'],
'links': value['links'] == null ? undefined : ((value['links'] as Array<any>).map(LinkToJSON)),
'interests': value['interests'] == null ? undefined : ((value['interests'] as Array<any>).map(InterestToJSON)),
'payments': ProfilePaymentsToJSON(value['payments']),
'contact_info': ProfileContactInfoToJSON(value['contactInfo']),
'gallery': value['gallery'] == null ? undefined : ((value['gallery'] as Array<any>).map(GalleryImageToJSON)),
'number_verified_accounts': value['numberVerifiedAccounts'],
'last_profile_edit': value['lastProfileEdit'] == null ? undefined : ((value['lastProfileEdit'] as any).toISOString()),
'registration_date': value['registrationDate'] == null ? undefined : ((value['registrationDate'] as any).toISOString()),
};
}