/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; /** * Rich context object with id and optional data */ export type GenerateLinkUserOauthUrlRequestDtoContext2 = { id: string; /** * Optional additional context data */ data?: { [k: string]: any } | undefined; }; export type GenerateLinkUserOauthUrlRequestDtoContext = | GenerateLinkUserOauthUrlRequestDtoContext2 | string; export type GenerateLinkUserOauthUrlRequestDto = { /** * The subscriber ID to link to their chat identity. Required — this operation always binds a specific subscriber to a user identity in the chat provider. */ subscriberId: string; /** * Integration identifier */ integrationIdentifier: string; /** * Identifier of the existing channel connection to associate this user endpoint with. Generated automatically if not provided. */ connectionIdentifier?: string | undefined; context?: | { [k: string]: GenerateLinkUserOauthUrlRequestDtoContext2 | string } | undefined; /** * **Slack only**: User-level OAuth scopes for "Sign in with Slack". Defaults to: identity.basic. **MS Teams**: ignored — uses delegated OpenID scopes (openid, profile, User.Read). */ userScope?: Array | undefined; }; /** @internal */ export type GenerateLinkUserOauthUrlRequestDtoContext2$Outbound = { id: string; data?: { [k: string]: any } | undefined; }; /** @internal */ export const GenerateLinkUserOauthUrlRequestDtoContext2$outboundSchema: z.ZodType< GenerateLinkUserOauthUrlRequestDtoContext2$Outbound, z.ZodTypeDef, GenerateLinkUserOauthUrlRequestDtoContext2 > = z.object({ id: z.string(), data: z.record(z.any()).optional(), }); export function generateLinkUserOauthUrlRequestDtoContext2ToJSON( generateLinkUserOauthUrlRequestDtoContext2: GenerateLinkUserOauthUrlRequestDtoContext2, ): string { return JSON.stringify( GenerateLinkUserOauthUrlRequestDtoContext2$outboundSchema.parse( generateLinkUserOauthUrlRequestDtoContext2, ), ); } /** @internal */ export type GenerateLinkUserOauthUrlRequestDtoContext$Outbound = | GenerateLinkUserOauthUrlRequestDtoContext2$Outbound | string; /** @internal */ export const GenerateLinkUserOauthUrlRequestDtoContext$outboundSchema: z.ZodType< GenerateLinkUserOauthUrlRequestDtoContext$Outbound, z.ZodTypeDef, GenerateLinkUserOauthUrlRequestDtoContext > = z.union([ z.lazy(() => GenerateLinkUserOauthUrlRequestDtoContext2$outboundSchema), z.string(), ]); export function generateLinkUserOauthUrlRequestDtoContextToJSON( generateLinkUserOauthUrlRequestDtoContext: GenerateLinkUserOauthUrlRequestDtoContext, ): string { return JSON.stringify( GenerateLinkUserOauthUrlRequestDtoContext$outboundSchema.parse( generateLinkUserOauthUrlRequestDtoContext, ), ); } /** @internal */ export type GenerateLinkUserOauthUrlRequestDto$Outbound = { subscriberId: string; integrationIdentifier: string; connectionIdentifier?: string | undefined; context?: { [k: string]: GenerateLinkUserOauthUrlRequestDtoContext2$Outbound | string; } | undefined; userScope?: Array | undefined; }; /** @internal */ export const GenerateLinkUserOauthUrlRequestDto$outboundSchema: z.ZodType< GenerateLinkUserOauthUrlRequestDto$Outbound, z.ZodTypeDef, GenerateLinkUserOauthUrlRequestDto > = z.object({ subscriberId: z.string(), integrationIdentifier: z.string(), connectionIdentifier: z.string().optional(), context: z.record( z.union([ z.lazy(() => GenerateLinkUserOauthUrlRequestDtoContext2$outboundSchema), z.string(), ]), ).optional(), userScope: z.array(z.string()).optional(), }); export function generateLinkUserOauthUrlRequestDtoToJSON( generateLinkUserOauthUrlRequestDto: GenerateLinkUserOauthUrlRequestDto, ): string { return JSON.stringify( GenerateLinkUserOauthUrlRequestDto$outboundSchema.parse( generateLinkUserOauthUrlRequestDto, ), ); }