/** * Do not edit this file it is auto-generated by io-utils / gen-api-models. * See https://github.com/pagopa/io-utils */ /* tslint:disable */ import * as t from "io-ts"; import { FiscalCode } from "./FiscalCode"; import { TimeToLiveSeconds } from "./TimeToLiveSeconds"; import { Timestamp } from "./Timestamp"; import { MessageContent } from "./MessageContent"; import { NotificationChannelStatusValue } from "./NotificationChannelStatusValue"; import { enumType } from "italia-ts-commons/lib/types"; export enum StatusEnum { "ACCEPTED" = "ACCEPTED", "THROTTLED" = "THROTTLED", "FAILED" = "FAILED", "PROCESSED" = "PROCESSED", "REJECTED" = "REJECTED" } // required attributes const MessageResponseWithContentMessageR = t.interface({ id: t.string, fiscal_code: FiscalCode, created_at: Timestamp, content: MessageContent, sender_service_id: t.string }); // optional attributes const MessageResponseWithContentMessageO = t.partial({ time_to_live: TimeToLiveSeconds }); export const MessageResponseWithContentMessage = t.exact( t.intersection( [MessageResponseWithContentMessageR, MessageResponseWithContentMessageO], "MessageResponseWithContentMessage" ) ); export type MessageResponseWithContentMessage = t.TypeOf< typeof MessageResponseWithContentMessage >; // required attributes const MessageResponseWithContentNotificationR = t.interface({}); // optional attributes const MessageResponseWithContentNotificationO = t.partial({ email: NotificationChannelStatusValue, webhook: NotificationChannelStatusValue }); export const MessageResponseWithContentNotification = t.exact( t.intersection( [ MessageResponseWithContentNotificationR, MessageResponseWithContentNotificationO ], "MessageResponseWithContentNotification" ) ); export type MessageResponseWithContentNotification = t.TypeOf< typeof MessageResponseWithContentNotification >; // required attributes const MessageResponseWithContentR = t.interface({ message: MessageResponseWithContentMessage }); // optional attributes const MessageResponseWithContentO = t.partial({ notification: MessageResponseWithContentNotification, status: enumType(StatusEnum, "status") }); export const MessageResponseWithContent = t.exact( t.intersection( [MessageResponseWithContentR, MessageResponseWithContentO], "MessageResponseWithContent" ) ); export type MessageResponseWithContent = t.TypeOf< typeof MessageResponseWithContent >;