/** * 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 { ServicePayload } from "./ServicePayload"; import { ServiceId } from "./ServiceId"; import { FiscalCode } from "./FiscalCode"; import { withDefault } from "italia-ts-commons/lib/types"; import { IWithinRangeIntegerTag, WithinRangeInteger } from "italia-ts-commons/lib/numbers"; type MaxAllowedPaymentAmountBase = t.TypeOf; const MaxAllowedPaymentAmountBase = t.union([ WithinRangeInteger<0, 9999999999, IWithinRangeIntegerTag<0, 9999999999>>( 0, 9999999999 ), t.literal(9999999999) ]); /** * A service tied to user's subscription. */ // required attributes const Service2R = t.interface({ service_id: ServiceId, authorized_recipients: t.readonlyArray(FiscalCode, "array of FiscalCode") }); // optional attributes const Service2O = t.partial({ id: t.string, max_allowed_payment_amount: withDefault( MaxAllowedPaymentAmountBase, 0 as MaxAllowedPaymentAmountBase ) }); export const Service2 = t.exact( t.intersection([Service2R, Service2O], "Service2") ); export type Service2 = t.TypeOf; export const Service = t.intersection([ServicePayload, Service2], "Service"); export type Service = t.TypeOf;