// DO NOT EDIT THIS FILE // This file has been generated by gen-api-models // eslint-disable sonar/max-union-size // eslint-disable sonarjs/no-identical-functions import * as t from "io-ts"; import * as r from "@pagopa/ts-commons/lib/requests"; import { PaginatedPublicMessagesCollection } from "./PaginatedPublicMessagesCollection"; import { ProblemJson } from "./ProblemJson"; import { InternalMessageResponseWithContent } from "./InternalMessageResponseWithContent"; import { MessageStatusChange } from "./MessageStatusChange"; import { MessageStatusWithAttributes } from "./MessageStatusWithAttributes"; import { RCConfigurationPublic } from "./RCConfigurationPublic"; /**************************************************************** * getMessagesByUser */ // Request type definition export type GetMessagesByUserT = r.IGetApiRequestType< { readonly SubscriptionKey: string; readonly fiscal_code: string; readonly page_size?: number; readonly maximum_id?: string; readonly minimum_id?: string; readonly enrich_result_data?: boolean; readonly archived?: boolean; }, "X-Functions-Key", never, | r.IResponseType<200, PaginatedPublicMessagesCollection, never> | r.IResponseType<401, undefined, never> | r.IResponseType<404, ProblemJson, never> | r.IResponseType<429, undefined, never> | r.IResponseType<500, undefined, never> >; export const getMessagesByUserDefaultResponses = { 200: PaginatedPublicMessagesCollection, 401: t.undefined, 404: ProblemJson, 429: t.undefined, 500: t.undefined }; export type GetMessagesByUserResponsesT< A0 = PaginatedPublicMessagesCollection, C0 = PaginatedPublicMessagesCollection, A1 = undefined, C1 = undefined, A2 = ProblemJson, C2 = ProblemJson, A3 = undefined, C3 = undefined, A4 = undefined, C4 = undefined > = { 200: t.Type; 401: t.Type; 404: t.Type; 429: t.Type; 500: t.Type; }; export function getMessagesByUserDecoder< A0 = PaginatedPublicMessagesCollection, C0 = PaginatedPublicMessagesCollection, A1 = undefined, C1 = undefined, A2 = ProblemJson, C2 = ProblemJson, A3 = undefined, C3 = undefined, A4 = undefined, C4 = undefined >( overrideTypes: | Partial< GetMessagesByUserResponsesT > | t.Type | undefined = {} ): r.ResponseDecoder< | r.IResponseType<200, A0, never> | r.IResponseType<401, A1, never> | r.IResponseType<404, A2, never> | r.IResponseType<429, A3, never> | r.IResponseType<500, A4, never> > { const isDecoder = (d: any): d is t.Type => typeof d["_A"] !== "undefined"; const type = { ...((getMessagesByUserDefaultResponses as unknown) as GetMessagesByUserResponsesT< A0, C0, A1, C1, A2, C2, A3, C3, A4, C4 >), ...(isDecoder(overrideTypes) ? { 200: overrideTypes } : overrideTypes) }; const d200 = (type[200].name === "undefined" ? r.constantResponseDecoder(200, undefined) : r.ioResponseDecoder< 200, typeof type[200]["_A"], typeof type[200]["_O"], never >(200, type[200])) as r.ResponseDecoder>; const d401 = (type[401].name === "undefined" ? r.constantResponseDecoder(401, undefined) : r.ioResponseDecoder< 401, typeof type[401]["_A"], typeof type[401]["_O"], never >(401, type[401])) as r.ResponseDecoder>; const d404 = (type[404].name === "undefined" ? r.constantResponseDecoder(404, undefined) : r.ioResponseDecoder< 404, typeof type[404]["_A"], typeof type[404]["_O"], never >(404, type[404])) as r.ResponseDecoder>; const d429 = (type[429].name === "undefined" ? r.constantResponseDecoder(429, undefined) : r.ioResponseDecoder< 429, typeof type[429]["_A"], typeof type[429]["_O"], never >(429, type[429])) as r.ResponseDecoder>; const d500 = (type[500].name === "undefined" ? r.constantResponseDecoder(500, undefined) : r.ioResponseDecoder< 500, typeof type[500]["_A"], typeof type[500]["_O"], never >(500, type[500])) as r.ResponseDecoder>; return r.composeResponseDecoders( r.composeResponseDecoders( r.composeResponseDecoders(r.composeResponseDecoders(d200, d401), d404), d429 ), d500 ); } // Decodes the success response with the type defined in the specs export const getMessagesByUserDefaultDecoder = () => getMessagesByUserDecoder(); /**************************************************************** * getMessage */ // Request type definition export type GetMessageT = r.IGetApiRequestType< { readonly SubscriptionKey: string; readonly fiscal_code: string; readonly id: string; readonly public_message?: boolean; }, "X-Functions-Key", never, | r.IResponseType<200, InternalMessageResponseWithContent, never> | r.IResponseType<401, undefined, never> | r.IResponseType<404, ProblemJson, never> | r.IResponseType<429, undefined, never> >; export const getMessageDefaultResponses = { 200: InternalMessageResponseWithContent, 401: t.undefined, 404: ProblemJson, 429: t.undefined }; export type GetMessageResponsesT< A0 = InternalMessageResponseWithContent, C0 = InternalMessageResponseWithContent, A1 = undefined, C1 = undefined, A2 = ProblemJson, C2 = ProblemJson, A3 = undefined, C3 = undefined > = { 200: t.Type; 401: t.Type; 404: t.Type; 429: t.Type; }; export function getMessageDecoder< A0 = InternalMessageResponseWithContent, C0 = InternalMessageResponseWithContent, A1 = undefined, C1 = undefined, A2 = ProblemJson, C2 = ProblemJson, A3 = undefined, C3 = undefined >( overrideTypes: | Partial> | t.Type | undefined = {} ): r.ResponseDecoder< | r.IResponseType<200, A0, never> | r.IResponseType<401, A1, never> | r.IResponseType<404, A2, never> | r.IResponseType<429, A3, never> > { const isDecoder = (d: any): d is t.Type => typeof d["_A"] !== "undefined"; const type = { ...((getMessageDefaultResponses as unknown) as GetMessageResponsesT< A0, C0, A1, C1, A2, C2, A3, C3 >), ...(isDecoder(overrideTypes) ? { 200: overrideTypes } : overrideTypes) }; const d200 = (type[200].name === "undefined" ? r.constantResponseDecoder(200, undefined) : r.ioResponseDecoder< 200, typeof type[200]["_A"], typeof type[200]["_O"], never >(200, type[200])) as r.ResponseDecoder>; const d401 = (type[401].name === "undefined" ? r.constantResponseDecoder(401, undefined) : r.ioResponseDecoder< 401, typeof type[401]["_A"], typeof type[401]["_O"], never >(401, type[401])) as r.ResponseDecoder>; const d404 = (type[404].name === "undefined" ? r.constantResponseDecoder(404, undefined) : r.ioResponseDecoder< 404, typeof type[404]["_A"], typeof type[404]["_O"], never >(404, type[404])) as r.ResponseDecoder>; const d429 = (type[429].name === "undefined" ? r.constantResponseDecoder(429, undefined) : r.ioResponseDecoder< 429, typeof type[429]["_A"], typeof type[429]["_O"], never >(429, type[429])) as r.ResponseDecoder>; return r.composeResponseDecoders( r.composeResponseDecoders(r.composeResponseDecoders(d200, d401), d404), d429 ); } // Decodes the success response with the type defined in the specs export const getMessageDefaultDecoder = () => getMessageDecoder(); /**************************************************************** * upsertMessageStatusAttributes */ // Request type definition export type UpsertMessageStatusAttributesT = r.IPutApiRequestType< { readonly SubscriptionKey: string; readonly fiscal_code: string; readonly id: string; readonly body: MessageStatusChange; }, "Content-Type" | "X-Functions-Key", never, | r.IResponseType<200, MessageStatusWithAttributes, never> | r.IResponseType<401, undefined, never> | r.IResponseType<403, undefined, never> | r.IResponseType<404, ProblemJson, never> | r.IResponseType<429, undefined, never> >; export const upsertMessageStatusAttributesDefaultResponses = { 200: MessageStatusWithAttributes, 401: t.undefined, 403: t.undefined, 404: ProblemJson, 429: t.undefined }; export type UpsertMessageStatusAttributesResponsesT< A0 = MessageStatusWithAttributes, C0 = MessageStatusWithAttributes, A1 = undefined, C1 = undefined, A2 = undefined, C2 = undefined, A3 = ProblemJson, C3 = ProblemJson, A4 = undefined, C4 = undefined > = { 200: t.Type; 401: t.Type; 403: t.Type; 404: t.Type; 429: t.Type; }; export function upsertMessageStatusAttributesDecoder< A0 = MessageStatusWithAttributes, C0 = MessageStatusWithAttributes, A1 = undefined, C1 = undefined, A2 = undefined, C2 = undefined, A3 = ProblemJson, C3 = ProblemJson, A4 = undefined, C4 = undefined >( overrideTypes: | Partial< UpsertMessageStatusAttributesResponsesT< A0, C0, A1, C1, A2, C2, A3, C3, A4, C4 > > | t.Type | undefined = {} ): r.ResponseDecoder< | r.IResponseType<200, A0, never> | r.IResponseType<401, A1, never> | r.IResponseType<403, A2, never> | r.IResponseType<404, A3, never> | r.IResponseType<429, A4, never> > { const isDecoder = (d: any): d is t.Type => typeof d["_A"] !== "undefined"; const type = { ...((upsertMessageStatusAttributesDefaultResponses as unknown) as UpsertMessageStatusAttributesResponsesT< A0, C0, A1, C1, A2, C2, A3, C3, A4, C4 >), ...(isDecoder(overrideTypes) ? { 200: overrideTypes } : overrideTypes) }; const d200 = (type[200].name === "undefined" ? r.constantResponseDecoder(200, undefined) : r.ioResponseDecoder< 200, typeof type[200]["_A"], typeof type[200]["_O"], never >(200, type[200])) as r.ResponseDecoder>; const d401 = (type[401].name === "undefined" ? r.constantResponseDecoder(401, undefined) : r.ioResponseDecoder< 401, typeof type[401]["_A"], typeof type[401]["_O"], never >(401, type[401])) as r.ResponseDecoder>; const d403 = (type[403].name === "undefined" ? r.constantResponseDecoder(403, undefined) : r.ioResponseDecoder< 403, typeof type[403]["_A"], typeof type[403]["_O"], never >(403, type[403])) as r.ResponseDecoder>; const d404 = (type[404].name === "undefined" ? r.constantResponseDecoder(404, undefined) : r.ioResponseDecoder< 404, typeof type[404]["_A"], typeof type[404]["_O"], never >(404, type[404])) as r.ResponseDecoder>; const d429 = (type[429].name === "undefined" ? r.constantResponseDecoder(429, undefined) : r.ioResponseDecoder< 429, typeof type[429]["_A"], typeof type[429]["_O"], never >(429, type[429])) as r.ResponseDecoder>; return r.composeResponseDecoders( r.composeResponseDecoders( r.composeResponseDecoders(r.composeResponseDecoders(d200, d401), d403), d404 ), d429 ); } // Decodes the success response with the type defined in the specs export const upsertMessageStatusAttributesDefaultDecoder = () => upsertMessageStatusAttributesDecoder(); /**************************************************************** * getRCConfiguration */ // Request type definition export type GetRCConfigurationT = r.IGetApiRequestType< { readonly SubscriptionKey: string; readonly id: string }, "X-Functions-Key", never, | r.IResponseType<200, RCConfigurationPublic, never> | r.IResponseType<401, undefined, never> | r.IResponseType<404, ProblemJson, never> | r.IResponseType<429, undefined, never> >; export const getRCConfigurationDefaultResponses = { 200: RCConfigurationPublic, 401: t.undefined, 404: ProblemJson, 429: t.undefined }; export type GetRCConfigurationResponsesT< A0 = RCConfigurationPublic, C0 = RCConfigurationPublic, A1 = undefined, C1 = undefined, A2 = ProblemJson, C2 = ProblemJson, A3 = undefined, C3 = undefined > = { 200: t.Type; 401: t.Type; 404: t.Type; 429: t.Type; }; export function getRCConfigurationDecoder< A0 = RCConfigurationPublic, C0 = RCConfigurationPublic, A1 = undefined, C1 = undefined, A2 = ProblemJson, C2 = ProblemJson, A3 = undefined, C3 = undefined >( overrideTypes: | Partial> | t.Type | undefined = {} ): r.ResponseDecoder< | r.IResponseType<200, A0, never> | r.IResponseType<401, A1, never> | r.IResponseType<404, A2, never> | r.IResponseType<429, A3, never> > { const isDecoder = (d: any): d is t.Type => typeof d["_A"] !== "undefined"; const type = { ...((getRCConfigurationDefaultResponses as unknown) as GetRCConfigurationResponsesT< A0, C0, A1, C1, A2, C2, A3, C3 >), ...(isDecoder(overrideTypes) ? { 200: overrideTypes } : overrideTypes) }; const d200 = (type[200].name === "undefined" ? r.constantResponseDecoder(200, undefined) : r.ioResponseDecoder< 200, typeof type[200]["_A"], typeof type[200]["_O"], never >(200, type[200])) as r.ResponseDecoder>; const d401 = (type[401].name === "undefined" ? r.constantResponseDecoder(401, undefined) : r.ioResponseDecoder< 401, typeof type[401]["_A"], typeof type[401]["_O"], never >(401, type[401])) as r.ResponseDecoder>; const d404 = (type[404].name === "undefined" ? r.constantResponseDecoder(404, undefined) : r.ioResponseDecoder< 404, typeof type[404]["_A"], typeof type[404]["_O"], never >(404, type[404])) as r.ResponseDecoder>; const d429 = (type[429].name === "undefined" ? r.constantResponseDecoder(429, undefined) : r.ioResponseDecoder< 429, typeof type[429]["_A"], typeof type[429]["_O"], never >(429, type[429])) as r.ResponseDecoder>; return r.composeResponseDecoders( r.composeResponseDecoders(r.composeResponseDecoders(d200, d401), d404), d429 ); } // Decodes the success response with the type defined in the specs export const getRCConfigurationDefaultDecoder = () => getRCConfigurationDecoder();