/** * Do not edit this file it is auto-generated by io-utils / gen-api-models. * See https://github.com/pagopa/io-utils */ /* eslint-disable */ import { EmailAddress } from "./EmailAddress"; import { ServicePreferencesSettings } from "./ServicePreferencesSettings"; import { BlockedInboxOrChannels } from "./BlockedInboxOrChannels"; import { PreferredLanguages } from "./PreferredLanguages"; import { IsInboxEnabled } from "./IsInboxEnabled"; import { AcceptedTosVersion } from "./AcceptedTosVersion"; import { IsWebhookEnabled } from "./IsWebhookEnabled"; import { IsEmailEnabled } from "./IsEmailEnabled"; import { IsEmailValidated } from "./IsEmailValidated"; import { ReminderStatus } from "./ReminderStatus"; import { IsTestProfile } from "./IsTestProfile"; import { AppVersion } from "./AppVersion"; import { PushNotificationsContentType } from "./PushNotificationsContentType"; import { withDefault } from "@pagopa/ts-commons/lib/types"; import * as t from "io-ts"; /** * Describes the citizen's profile, mostly interesting for preferences * attributes. */ // required attributes const ExtendedProfileR = t.interface({ service_preferences_settings: ServicePreferencesSettings, is_inbox_enabled: IsInboxEnabled, is_webhook_enabled: IsWebhookEnabled, is_email_enabled: IsEmailEnabled, is_email_validated: IsEmailValidated, is_email_already_taken: withDefault(t.boolean, false), version: t.Integer }); // optional attributes const ExtendedProfileO = t.partial({ email: EmailAddress, blocked_inbox_or_channels: BlockedInboxOrChannels, preferred_languages: PreferredLanguages, accepted_tos_version: AcceptedTosVersion, reminder_status: ReminderStatus, is_test_profile: IsTestProfile, last_app_version: AppVersion, push_notifications_content_type: PushNotificationsContentType }); export const ExtendedProfile = t.exact( t.intersection([ExtendedProfileR, ExtendedProfileO], "ExtendedProfile") ); export type ExtendedProfile = t.TypeOf;