/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type SubscriberGetPushSubscriptionDeliveryRequest = { /** * The subscription id. */ subscriptionId: string; /** * The delivery id. */ deliveryId: string; }; export type SubscriberGetPushSubscriptionDeliveryResponse = { httpMeta: components.HTTPMetadata; /** * OK */ pushSubscriptionDelivery?: components.PushSubscriptionDelivery | undefined; /** * INVALID_ARGUMENT: The request was not well formed. */ status?: components.Status | undefined; }; /** @internal */ export const SubscriberGetPushSubscriptionDeliveryRequest$inboundSchema: z.ZodType< SubscriberGetPushSubscriptionDeliveryRequest, z.ZodTypeDef, unknown > = z.object({ subscription_id: z.string(), delivery_id: z.string(), }).transform((v) => { return remap$(v, { "subscription_id": "subscriptionId", "delivery_id": "deliveryId", }); }); /** @internal */ export type SubscriberGetPushSubscriptionDeliveryRequest$Outbound = { subscription_id: string; delivery_id: string; }; /** @internal */ export const SubscriberGetPushSubscriptionDeliveryRequest$outboundSchema: z.ZodType< SubscriberGetPushSubscriptionDeliveryRequest$Outbound, z.ZodTypeDef, SubscriberGetPushSubscriptionDeliveryRequest > = z.object({ subscriptionId: z.string(), deliveryId: z.string(), }).transform((v) => { return remap$(v, { subscriptionId: "subscription_id", deliveryId: "delivery_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SubscriberGetPushSubscriptionDeliveryRequest$ { /** @deprecated use `SubscriberGetPushSubscriptionDeliveryRequest$inboundSchema` instead. */ export const inboundSchema = SubscriberGetPushSubscriptionDeliveryRequest$inboundSchema; /** @deprecated use `SubscriberGetPushSubscriptionDeliveryRequest$outboundSchema` instead. */ export const outboundSchema = SubscriberGetPushSubscriptionDeliveryRequest$outboundSchema; /** @deprecated use `SubscriberGetPushSubscriptionDeliveryRequest$Outbound` instead. */ export type Outbound = SubscriberGetPushSubscriptionDeliveryRequest$Outbound; } export function subscriberGetPushSubscriptionDeliveryRequestToJSON( subscriberGetPushSubscriptionDeliveryRequest: SubscriberGetPushSubscriptionDeliveryRequest, ): string { return JSON.stringify( SubscriberGetPushSubscriptionDeliveryRequest$outboundSchema.parse( subscriberGetPushSubscriptionDeliveryRequest, ), ); } export function subscriberGetPushSubscriptionDeliveryRequestFromJSON( jsonString: string, ): SafeParseResult< SubscriberGetPushSubscriptionDeliveryRequest, SDKValidationError > { return safeParse( jsonString, (x) => SubscriberGetPushSubscriptionDeliveryRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'SubscriberGetPushSubscriptionDeliveryRequest' from JSON`, ); } /** @internal */ export const SubscriberGetPushSubscriptionDeliveryResponse$inboundSchema: z.ZodType< SubscriberGetPushSubscriptionDeliveryResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, PushSubscriptionDelivery: components.PushSubscriptionDelivery$inboundSchema .optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "PushSubscriptionDelivery": "pushSubscriptionDelivery", "Status": "status", }); }); /** @internal */ export type SubscriberGetPushSubscriptionDeliveryResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; PushSubscriptionDelivery?: | components.PushSubscriptionDelivery$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const SubscriberGetPushSubscriptionDeliveryResponse$outboundSchema: z.ZodType< SubscriberGetPushSubscriptionDeliveryResponse$Outbound, z.ZodTypeDef, SubscriberGetPushSubscriptionDeliveryResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, pushSubscriptionDelivery: components.PushSubscriptionDelivery$outboundSchema .optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", pushSubscriptionDelivery: "PushSubscriptionDelivery", status: "Status", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SubscriberGetPushSubscriptionDeliveryResponse$ { /** @deprecated use `SubscriberGetPushSubscriptionDeliveryResponse$inboundSchema` instead. */ export const inboundSchema = SubscriberGetPushSubscriptionDeliveryResponse$inboundSchema; /** @deprecated use `SubscriberGetPushSubscriptionDeliveryResponse$outboundSchema` instead. */ export const outboundSchema = SubscriberGetPushSubscriptionDeliveryResponse$outboundSchema; /** @deprecated use `SubscriberGetPushSubscriptionDeliveryResponse$Outbound` instead. */ export type Outbound = SubscriberGetPushSubscriptionDeliveryResponse$Outbound; } export function subscriberGetPushSubscriptionDeliveryResponseToJSON( subscriberGetPushSubscriptionDeliveryResponse: SubscriberGetPushSubscriptionDeliveryResponse, ): string { return JSON.stringify( SubscriberGetPushSubscriptionDeliveryResponse$outboundSchema.parse( subscriberGetPushSubscriptionDeliveryResponse, ), ); } export function subscriberGetPushSubscriptionDeliveryResponseFromJSON( jsonString: string, ): SafeParseResult< SubscriberGetPushSubscriptionDeliveryResponse, SDKValidationError > { return safeParse( jsonString, (x) => SubscriberGetPushSubscriptionDeliveryResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'SubscriberGetPushSubscriptionDeliveryResponse' from JSON`, ); }