import * as z from "zod/v3";
import { OpenEnum } from "../../types/enums.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import { AuthType } from "./authtype.js";
import { ConnectionState } from "./connectionstate.js";
import { ConsentRecord } from "./consentrecord.js";
import { ConsentRecordInput, ConsentRecordInput$Outbound } from "./consentrecordinput.js";
import { ConsentState } from "./consentstate.js";
import { CustomMapping } from "./custommapping.js";
import { CustomMappingInput, CustomMappingInput$Outbound } from "./custommappinginput.js";
import { DataScopes } from "./datascopes.js";
import { DataScopesInput, DataScopesInput$Outbound } from "./datascopesinput.js";
import { FormField } from "./formfield.js";
import { FormFieldOption, FormFieldOption$Outbound } from "./formfieldoption.js";
import { IntegrationState } from "./integrationstate.js";
import { OAuthGrantType } from "./oauthgranttype.js";
import { WebhookSubscription } from "./webhooksubscription.js";
/**
 * Status of the connection.
 */
export declare const ConnectionStatus: {
    readonly Live: "live";
    readonly Upcoming: "upcoming";
    readonly Requested: "requested";
};
/**
 * Status of the connection.
 */
export type ConnectionStatus = OpenEnum<typeof ConnectionStatus>;
export declare const Target: {
    readonly CustomFields: "custom_fields";
    readonly Resource: "resource";
};
export type Target = OpenEnum<typeof Target>;
export type Value5 = string | number | number;
export type ConnectionValue = string | number | number | boolean | Array<string | number | number>;
export type Defaults = {
    target?: Target | undefined;
    id?: string | undefined;
    options?: Array<FormFieldOption> | undefined;
    value?: string | number | number | boolean | Array<string | number | number> | undefined;
};
export type Configuration = {
    resource?: string | undefined;
    defaults?: Array<Defaults> | undefined;
};
/**
 * Operational health status of the connection
 */
export declare const Health: {
    readonly Revoked: "revoked";
    readonly MissingSettings: "missing_settings";
    readonly NeedsConsent: "needs_consent";
    readonly NeedsAuth: "needs_auth";
    readonly PendingRefresh: "pending_refresh";
    readonly Ok: "ok";
};
/**
 * Operational health status of the connection
 */
export type Health = OpenEnum<typeof Health>;
export type Connection = {
    /**
     * The unique identifier of the connection.
     */
    id?: string | undefined;
    /**
     * The ID of the service this connection belongs to.
     */
    serviceId?: string | undefined;
    /**
     * The name of the connection
     */
    name?: string | undefined;
    tagLine?: string | undefined;
    /**
     * The unified API category where the connection belongs to.
     */
    unifiedApi?: string | undefined;
    /**
     * [Connection state flow](#section/Connection-state)
     */
    state?: ConnectionState | undefined;
    /**
     * The current state of the Integration.
     */
    integrationState?: IntegrationState | undefined;
    /**
     * Type of authorization used by the connector
     */
    authType?: AuthType | undefined;
    /**
     * OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types
     */
    oauthGrantType?: OAuthGrantType | undefined;
    /**
     * Status of the connection.
     */
    status?: ConnectionStatus | undefined;
    /**
     * Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API.
     */
    enabled?: boolean | undefined;
    /**
     * The website URL of the connection
     */
    website?: string | undefined;
    /**
     * A visual icon of the connection, that will be shown in the Vault
     */
    icon?: string | undefined;
    /**
     * The logo of the connection, that will be shown in the Vault
     */
    logo?: string | undefined;
    /**
     * The OAuth redirect URI. Redirect your users to this URI to let them authorize your app in the connector's UI. Before you can use this URI, you must add `redirect_uri` as a query parameter to the `authorize_url`. Be sure to URL encode the `redirect_uri` part. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI.
     */
    authorizeUrl?: string | null | undefined;
    /**
     * The OAuth revoke URI. Redirect your users to this URI to revoke this connection. Before you can use this URI, you must add `redirect_uri` as a query parameter. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI.
     */
    revokeUrl?: string | null | undefined;
    /**
     * Connection settings. Values will persist to `form_fields` with corresponding id
     */
    settings?: {
        [k: string]: any;
    } | null | undefined;
    /**
     * Attach your own consumer specific metadata
     */
    metadata?: {
        [k: string]: any;
    } | null | undefined;
    /**
     * The settings that are wanted to create a connection.
     */
    formFields?: Array<FormField> | undefined;
    configuration?: Array<Configuration> | undefined;
    configurableResources?: Array<string> | undefined;
    resourceSchemaSupport?: Array<string> | undefined;
    resourceSettingsSupport?: Array<string> | undefined;
    validationSupport?: boolean | undefined;
    schemaSupport?: boolean | undefined;
    /**
     * List of settings that are required to be configured on integration before authorization can occur
     */
    settingsRequiredForAuthorization?: Array<string> | undefined;
    subscriptions?: Array<WebhookSubscription> | undefined;
    /**
     * Whether the connector has a guide available in the developer docs or not (https://docs.apideck.com/connectors/{service_id}/docs/consumer+connection).
     */
    hasGuide?: boolean | undefined;
    /**
     * List of custom mappings configured for this connection
     */
    customMappings?: Array<CustomMapping> | undefined;
    /**
     * The current consent state of the connection
     */
    consentState?: ConsentState | undefined;
    /**
     * Immutable array of consent records for compliance and audit purposes
     */
    consents?: Array<ConsentRecord> | undefined;
    latestConsent?: ConsentRecord | undefined;
    applicationDataScopes?: DataScopes | undefined;
    /**
     * Operational health status of the connection
     */
    health?: Health | undefined;
    /**
     * Unix timestamp in milliseconds when credentials will be deleted if token refresh continues to fail. A value of 0 indicates no active retention window (connection is healthy or not using OAuth token refresh).
     */
    credentialsExpireAt?: number | undefined;
    /**
     * Unix timestamp in milliseconds of the last failed token refresh attempt. A value of 0 indicates no recent failures. This field is used internally to enforce cooldown periods between retry attempts.
     */
    lastRefreshFailedAt?: number | undefined;
    createdAt?: number | undefined;
    updatedAt?: number | null | undefined;
};
export type ConnectionDefaults = {
    id?: string | undefined;
    options?: Array<FormFieldOption> | undefined;
    value?: string | number | number | boolean | Array<string | number | number> | undefined;
};
export type ConnectionConfiguration = {
    resource?: string | undefined;
    defaults?: Array<ConnectionDefaults> | undefined;
};
export type ConnectionInput = {
    /**
     * Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API.
     */
    enabled?: boolean | undefined;
    /**
     * Connection settings. Values will persist to `form_fields` with corresponding id
     */
    settings?: {
        [k: string]: any;
    } | null | undefined;
    /**
     * Attach your own consumer specific metadata
     */
    metadata?: {
        [k: string]: any;
    } | null | undefined;
    configuration?: Array<ConnectionConfiguration> | undefined;
    /**
     * List of custom mappings configured for this connection
     */
    customMappings?: Array<CustomMappingInput> | undefined;
    /**
     * The current consent state of the connection
     */
    consentState?: ConsentState | undefined;
    latestConsent?: ConsentRecordInput | undefined;
    applicationDataScopes?: DataScopesInput | undefined;
};
/** @internal */
export declare const ConnectionStatus$inboundSchema: z.ZodType<ConnectionStatus, z.ZodTypeDef, unknown>;
/** @internal */
export declare const Target$inboundSchema: z.ZodType<Target, z.ZodTypeDef, unknown>;
/** @internal */
export declare const Value5$inboundSchema: z.ZodType<Value5, z.ZodTypeDef, unknown>;
/** @internal */
export type Value5$Outbound = string | number | number;
/** @internal */
export declare const Value5$outboundSchema: z.ZodType<Value5$Outbound, z.ZodTypeDef, Value5>;
export declare function value5ToJSON(value5: Value5): string;
export declare function value5FromJSON(jsonString: string): SafeParseResult<Value5, SDKValidationError>;
/** @internal */
export declare const ConnectionValue$inboundSchema: z.ZodType<ConnectionValue, z.ZodTypeDef, unknown>;
/** @internal */
export type ConnectionValue$Outbound = string | number | number | boolean | Array<string | number | number>;
/** @internal */
export declare const ConnectionValue$outboundSchema: z.ZodType<ConnectionValue$Outbound, z.ZodTypeDef, ConnectionValue>;
export declare function connectionValueToJSON(connectionValue: ConnectionValue): string;
export declare function connectionValueFromJSON(jsonString: string): SafeParseResult<ConnectionValue, SDKValidationError>;
/** @internal */
export declare const Defaults$inboundSchema: z.ZodType<Defaults, z.ZodTypeDef, unknown>;
export declare function defaultsFromJSON(jsonString: string): SafeParseResult<Defaults, SDKValidationError>;
/** @internal */
export declare const Configuration$inboundSchema: z.ZodType<Configuration, z.ZodTypeDef, unknown>;
export declare function configurationFromJSON(jsonString: string): SafeParseResult<Configuration, SDKValidationError>;
/** @internal */
export declare const Health$inboundSchema: z.ZodType<Health, z.ZodTypeDef, unknown>;
/** @internal */
export declare const Connection$inboundSchema: z.ZodType<Connection, z.ZodTypeDef, unknown>;
export declare function connectionFromJSON(jsonString: string): SafeParseResult<Connection, SDKValidationError>;
/** @internal */
export type ConnectionDefaults$Outbound = {
    id?: string | undefined;
    options?: Array<FormFieldOption$Outbound> | undefined;
    value?: string | number | number | boolean | Array<string | number | number> | undefined;
};
/** @internal */
export declare const ConnectionDefaults$outboundSchema: z.ZodType<ConnectionDefaults$Outbound, z.ZodTypeDef, ConnectionDefaults>;
export declare function connectionDefaultsToJSON(connectionDefaults: ConnectionDefaults): string;
/** @internal */
export type ConnectionConfiguration$Outbound = {
    resource?: string | undefined;
    defaults?: Array<ConnectionDefaults$Outbound> | undefined;
};
/** @internal */
export declare const ConnectionConfiguration$outboundSchema: z.ZodType<ConnectionConfiguration$Outbound, z.ZodTypeDef, ConnectionConfiguration>;
export declare function connectionConfigurationToJSON(connectionConfiguration: ConnectionConfiguration): string;
/** @internal */
export type ConnectionInput$Outbound = {
    enabled?: boolean | undefined;
    settings?: {
        [k: string]: any;
    } | null | undefined;
    metadata?: {
        [k: string]: any;
    } | null | undefined;
    configuration?: Array<ConnectionConfiguration$Outbound> | undefined;
    custom_mappings?: Array<CustomMappingInput$Outbound> | undefined;
    consent_state?: string | undefined;
    latest_consent?: ConsentRecordInput$Outbound | undefined;
    application_data_scopes?: DataScopesInput$Outbound | undefined;
};
/** @internal */
export declare const ConnectionInput$outboundSchema: z.ZodType<ConnectionInput$Outbound, z.ZodTypeDef, ConnectionInput>;
export declare function connectionInputToJSON(connectionInput: ConnectionInput): string;
//# sourceMappingURL=connection.d.ts.map