/* tslint:disable */
/* eslint-disable */
/**
 * ChatKitty Platform API
 * OpenAPI specification (OAS) for the ChatKitty Platform API. See the Interactive Docs to try ChatKitty API methods without writing code, and get the complete schema of resources exposed by the API.
 *
 * The version of the OpenAPI document: 2.106.8
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


import type { Configuration } from './configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
import type { RequestArgs } from './base';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';

export interface ApiError {
    'error': string;
    'explanation'?: string;
    'message': string;
    'properties'?: { [key: string]: object; };
    'timestamp': string;
}
/**
 * Application features that are enabled or disabled
 */
export interface ApplicationFeatureSettingsProperties {
    /**
     * Toggle state of this settings option
     */
    'guest_users': ApplicationFeatureSettingsPropertiesGuestUsersEnum;
    /**
     * Toggle state of this settings option
     */
    'user_created_channels': ApplicationFeatureSettingsPropertiesUserCreatedChannelsEnum;
}

export const ApplicationFeatureSettingsPropertiesGuestUsersEnum = {
    Disabled: 'DISABLED',
    Enabled: 'ENABLED'
} as const;

export type ApplicationFeatureSettingsPropertiesGuestUsersEnum = typeof ApplicationFeatureSettingsPropertiesGuestUsersEnum[keyof typeof ApplicationFeatureSettingsPropertiesGuestUsersEnum];
export const ApplicationFeatureSettingsPropertiesUserCreatedChannelsEnum = {
    Disabled: 'DISABLED',
    Enabled: 'ENABLED'
} as const;

export type ApplicationFeatureSettingsPropertiesUserCreatedChannelsEnum = typeof ApplicationFeatureSettingsPropertiesUserCreatedChannelsEnum[keyof typeof ApplicationFeatureSettingsPropertiesUserCreatedChannelsEnum];

export interface ApplicationJobResource {
    /**
     * The type of application job
     */
    'type': ApplicationJobResourceTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    'created_time': string;
    'ended_time'?: string;
    'file'?: string;
    /**
     * The running state of an application job
     */
    'state': ApplicationJobResourceStateEnum;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}

export const ApplicationJobResourceTypeEnum = {
    ChannelImport: 'CHANNEL_IMPORT',
    ChannelMembersImport: 'CHANNEL_MEMBERS_IMPORT',
    MessageImport: 'MESSAGE_IMPORT',
    UserImport: 'USER_IMPORT',
    MessageAnalyticsExport: 'MESSAGE_ANALYTICS_EXPORT'
} as const;

export type ApplicationJobResourceTypeEnum = typeof ApplicationJobResourceTypeEnum[keyof typeof ApplicationJobResourceTypeEnum];
export const ApplicationJobResourceStateEnum = {
    Pending: 'PENDING',
    Running: 'RUNNING',
    Finished: 'FINISHED',
    Failed: 'FAILED'
} as const;

export type ApplicationJobResourceStateEnum = typeof ApplicationJobResourceStateEnum[keyof typeof ApplicationJobResourceStateEnum];

export interface ApplicationResource {
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * ISO date-time this application was created
     */
    'created_time': string;
    /**
     * Primary API key assigned to this application
     */
    'key': string;
    /**
     * Custom properties attached to this application
     */
    'properties': { [key: string]: object; };
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
/**
 * Sent when a system message is sent
 */
export interface ApplicationSentSystemMessageNotificationData {
    'type': string;
    /**
     * The ID channel the message was sent. Deprecated: Use the channel property of this notification
     * @deprecated
     */
    'channel_id': number;
    'message': SystemMessageResource;
}
export interface ApplicationSettingsProperties {
    /**
     * Toggle state of this settings option
     */
    'guest_users': ApplicationSettingsPropertiesGuestUsersEnum;
    /**
     * Toggle state of this settings option
     */
    'user_created_channels': ApplicationSettingsPropertiesUserCreatedChannelsEnum;
}

export const ApplicationSettingsPropertiesGuestUsersEnum = {
    Disabled: 'DISABLED',
    Enabled: 'ENABLED'
} as const;

export type ApplicationSettingsPropertiesGuestUsersEnum = typeof ApplicationSettingsPropertiesGuestUsersEnum[keyof typeof ApplicationSettingsPropertiesGuestUsersEnum];
export const ApplicationSettingsPropertiesUserCreatedChannelsEnum = {
    Disabled: 'DISABLED',
    Enabled: 'ENABLED'
} as const;

export type ApplicationSettingsPropertiesUserCreatedChannelsEnum = typeof ApplicationSettingsPropertiesUserCreatedChannelsEnum[keyof typeof ApplicationSettingsPropertiesUserCreatedChannelsEnum];

export interface ApplicationSettingsResource {
    /**
     * Toggle state of this settings option
     */
    'guest_users': ApplicationSettingsResourceGuestUsersEnum;
    /**
     * Toggle state of this settings option
     */
    'user_created_channels': ApplicationSettingsResourceUserCreatedChannelsEnum;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}

export const ApplicationSettingsResourceGuestUsersEnum = {
    Disabled: 'DISABLED',
    Enabled: 'ENABLED'
} as const;

export type ApplicationSettingsResourceGuestUsersEnum = typeof ApplicationSettingsResourceGuestUsersEnum[keyof typeof ApplicationSettingsResourceGuestUsersEnum];
export const ApplicationSettingsResourceUserCreatedChannelsEnum = {
    Disabled: 'DISABLED',
    Enabled: 'ENABLED'
} as const;

export type ApplicationSettingsResourceUserCreatedChannelsEnum = typeof ApplicationSettingsResourceUserCreatedChannelsEnum[keyof typeof ApplicationSettingsResourceUserCreatedChannelsEnum];

export interface AuthenticationError {
    'error': string;
    'error_description': string;
}
export interface ChannelGenericEventResource {
    /**
     * Custom type of this event
     */
    'type': string;
    /**
     * Custom data associated with this event
     */
    'properties': { [key: string]: object; };
    'user'?: ChatUserProperties;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface ChannelImport {
    'type': string;
    /**
     * Username of the user who created this channel
     */
    'creator'?: string;
    /**
     * Unique value generated by the client which ChatKitty uses to recognize subsequent retries of the same request. Optional but recommended
     */
    'idempotency_key'?: string;
    /**
     * List of usernames of members of this channel
     */
    'members': Array<string>;
    /**
     * Custom data associated with this channel
     */
    'properties'?: { [key: string]: object; };
}
export interface ChannelInviteResource {
    /**
     * The time this invite was created
     */
    'created_time': string;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface ChannelMembershipImport {
    /**
     * Unique value generated by the client which ChatKitty uses to recognize subsequent retries of the same request. Optional but recommended
     */
    'idempotency_key'?: string;
    /**
     * Username of the user to be added as a member
     */
    'username': string;
}
export interface ChannelMembershipResource {
    'created_time': string;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
/**
 * A channel mention
 */
export interface ChannelMessageMentionProperties extends MessageMentionProperties {
    'channel': MessageMentionChannelProperties;
}


export interface ChannelProperties {
    /**
     * The type of this channel
     */
    'type': ChannelPropertiesTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The ISO date-time this channel was created
     */
    'created_time': string;
    'creator'?: ChatUserProperties;
    'last_received_message'?: MessageProperties;
    /**
     * Custom data associated with this channel
     */
    'properties': { [key: string]: object; };
}

export const ChannelPropertiesTypeEnum = {
    Direct: 'DIRECT',
    Public: 'PUBLIC',
    Private: 'PRIVATE'
} as const;

export type ChannelPropertiesTypeEnum = typeof ChannelPropertiesTypeEnum[keyof typeof ChannelPropertiesTypeEnum];

/**
 * @type ChannelResource
 */
export type ChannelResource = { type: 'DIRECT' } & DirectChannelResource | { type: 'PRIVATE' } & PrivateChannelResource | { type: 'PUBLIC' } & PublicChannelResource;

/**
 * The runtime this function executes on. Always a NodeJS runtime
 */
export interface ChatFunctionChatRuntimeProperties {
    /**
     * The type of this runtime. Always NODEJS
     */
    'type': ChatFunctionChatRuntimePropertiesTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The semantic version of this runtime
     */
    'version': string;
}

export const ChatFunctionChatRuntimePropertiesTypeEnum = {
    Nodejs: 'NODEJS'
} as const;

export type ChatFunctionChatRuntimePropertiesTypeEnum = typeof ChatFunctionChatRuntimePropertiesTypeEnum[keyof typeof ChatFunctionChatRuntimePropertiesTypeEnum];

export interface ChatFunctionInvocationResource {
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The function arguments passed into this function for this invocation
     */
    'args': { [key: string]: object; };
    /**
     * The ISO date-time of this invocation when the function was called
     */
    'created_time': string;
    /**
     * The result of this invocation when it completed
     */
    'result': { [key: string]: object; };
    /**
     * The running status of this invocation
     */
    'status': ChatFunctionInvocationResourceStatusEnum;
    /**
     * The version number of this function version when this invocation occured
     */
    'version_number': number;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}

export const ChatFunctionInvocationResourceStatusEnum = {
    Running: 'RUNNING',
    Succeeded: 'SUCCEEDED',
    Failed: 'FAILED'
} as const;

export type ChatFunctionInvocationResourceStatusEnum = typeof ChatFunctionInvocationResourceStatusEnum[keyof typeof ChatFunctionInvocationResourceStatusEnum];

export interface ChatFunctionResource {
    /**
     * The type of this function
     */
    'type': string;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The current version number of this function. Incremented every time a new version is deployed
     */
    'current_version_number': number;
    /**
     * Optional description of this function
     */
    'description'?: string;
    /**
     * True if this function is enabled
     */
    'enabled': boolean;
    /**
     * The name of this function
     */
    'name': string;
    'runtime': ChatFunctionChatRuntimeProperties;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface ChatFunctionVersionResource {
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * JavaScript/TypeScript code that runs when this function is executed
     */
    'handler_script': string;
    /**
     * The version number of this function version. Incremented from the previous version
     */
    'version_number': number;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
/**
 * The NPM dependencies version of this runtime
 */
export interface ChatRuntimeDependencyProperties {
    /**
     * True if this NPM package is automatically installed by ChatKitty and available by default in your chat functions
     */
    'default_dependency': boolean;
    /**
     * The name of the dependency NPM package
     */
    'name': string;
    /**
     * The version of the NPM package
     */
    'version': string;
}
export interface ChatRuntimeProperties {
    /**
     * The type of this runtime. Always NODEJS
     */
    'type': ChatRuntimePropertiesTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The NPM dependencies version of this runtime
     */
    'dependencies': Array<ChatRuntimeDependencyProperties>;
    /**
     * Environment variable set for this runtime. Accessible in the initialization script and chat functions associated with this runtime
     */
    'environment_variables': { [key: string]: string; };
    'initialization_script'?: ChatRuntimeScriptProperties;
    /**
     * The semantic version of this runtime
     */
    'version': string;
}

export const ChatRuntimePropertiesTypeEnum = {
    Nodejs: 'NODEJS'
} as const;

export type ChatRuntimePropertiesTypeEnum = typeof ChatRuntimePropertiesTypeEnum[keyof typeof ChatRuntimePropertiesTypeEnum];

export interface ChatRuntimeResource {
    /**
     * The type of this runtime. Always NODEJS
     */
    'type': ChatRuntimeResourceTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The NPM dependencies version of this runtime
     */
    'dependencies': Array<ChatRuntimeDependencyProperties>;
    /**
     * Environment variable set for this runtime. Accessible in the initialization script and chat functions associated with this runtime
     */
    'environment_variables': { [key: string]: string; };
    'initialization_script'?: ChatRuntimeScriptProperties;
    /**
     * The semantic version of this runtime
     */
    'version': string;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}

export const ChatRuntimeResourceTypeEnum = {
    Nodejs: 'NODEJS'
} as const;

export type ChatRuntimeResourceTypeEnum = typeof ChatRuntimeResourceTypeEnum[keyof typeof ChatRuntimeResourceTypeEnum];

export interface ChatRuntimeScriptProperties {
    /**
     * The JavaScript/TypeScript source of this script
     */
    'script': string;
}
export interface ChatSessionResource {
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * Time this session was created
     */
    'created_time': string;
    /**
     * Time this session ended. Present if state is ENDED
     */
    'end_time'?: string;
    'session': ChatUserSessionProperties;
    /**
     * State of this session. ACTIVE or ENDED
     */
    'state': ChatSessionResourceStateEnum;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}

export const ChatSessionResourceStateEnum = {
    Active: 'ACTIVE',
    Ended: 'ENDED'
} as const;

export type ChatSessionResourceStateEnum = typeof ChatSessionResourceStateEnum[keyof typeof ChatSessionResourceStateEnum];

/**
 * Reference to a user by ID
 */
export interface ChatUserIdReference {
    /**
     * User ID associated with this user 
     */
    'id': number;
}
export interface ChatUserImport {
    /**
     * Human readable name of this user. Shown to other users
     */
    'display_name': string;
    'display_picture'?: FileImport;
    /**
     * True if this user was created by a guest user session
     */
    'guest': boolean;
    /**
     * Unique value generated by the client which ChatKitty uses to recognize subsequent retries of the same request. Optional but recommended
     */
    'idempotency_key'?: string;
    /**
     * The unique name used to identify this user across ChatKitty. Also known as username
     */
    'name': string;
    /**
     * Custom data associated with this user
     */
    'properties': { [key: string]: object; };
}
/**
 * Sent when a user mentions a channel in a message
 */
export interface ChatUserMentionedChannelNotificationData {
    'type': string;
    /**
     * The ID of the channel the mentioning message was sent. Deprecated: Use the channel property of this notification
     * @deprecated
     */
    'channel_id': number;
    'mentioned_channel': ChannelResource;
    'message': TextMessageResource;
}
/**
 * Sent when a user mentions a user in a message
 */
export interface ChatUserMentionedChatUserNotificationData {
    'type': string;
    /**
     * The ID of the channel the mentioning message was sent. Deprecated: Use the channel property of this notification
     * @deprecated
     */
    'channel_id': number;
    'mentioned_user': ChatUserResource;
    'message': TextMessageResource;
}
/**
 * A user mention
 */
export interface ChatUserMessageMentionProperties extends MessageMentionProperties {
    'user': ChatUserProperties;
}


/**
 * @type ChatUserMessageResource
 * The message that was sent
 */
export type ChatUserMessageResource = { type: 'FILE' } & FileChatUserMessageResource | { type: 'TEXT' } & TextChatUserMessageResource;

/**
 * Presence status of this user
 */
export interface ChatUserPresenceProperties {
    /**
     * True if this user has an active user session
     */
    'online': boolean;
    /**
     * The availability status of this user
     */
    'status': string;
}
export interface ChatUserProperties {
    /**
     * Type of user
     */
    'type': ChatUserPropertiesTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * Call presence status of this user
     */
    'call_status'?: ChatUserPropertiesCallStatusEnum;
    /**
     * Human readable name of this user. Shown to other users
     */
    'display_name': string;
    /**
     * URL for this user\'s display picture
     */
    'display_picture_url': string;
    /**
     * True if this user was created by a guest user session
     */
    'isGuest': boolean;
    /**
     * The unique name used to identify this user across ChatKitty. Also known as username
     */
    'name': string;
    'presence': ChatUserPresenceProperties;
    /**
     * Custom data associated with this user
     */
    'properties': { [key: string]: object; };
}

export const ChatUserPropertiesTypeEnum = {
    Person: 'PERSON',
    Bot: 'BOT'
} as const;

export type ChatUserPropertiesTypeEnum = typeof ChatUserPropertiesTypeEnum[keyof typeof ChatUserPropertiesTypeEnum];
export const ChatUserPropertiesCallStatusEnum = {
    Available: 'AVAILABLE',
    InCall: 'IN_CALL'
} as const;

export type ChatUserPropertiesCallStatusEnum = typeof ChatUserPropertiesCallStatusEnum[keyof typeof ChatUserPropertiesCallStatusEnum];

/**
 * Sent when a user replies to a message
 */
export interface ChatUserRepliedToChatUserMessageNotificationData {
    'type': string;
    /**
     * The ID of channel the reply message was sent. Deprecated: Use the channel property of this notification
     * @deprecated
     */
    'channel_id': number;
    'message': MessageResource;
    'parent': MessageResource;
}
export interface ChatUserResource {
    /**
     * Type of user
     */
    'type': ChatUserResourceTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * Call presence status of this user
     */
    'call_status'?: ChatUserResourceCallStatusEnum;
    /**
     * Human readable name of this user. Shown to other users
     */
    'display_name': string;
    /**
     * URL for this user\'s display picture
     */
    'display_picture_url': string;
    /**
     * True if this user was created by a guest user session
     */
    'isGuest': boolean;
    /**
     * The unique name used to identify this user across ChatKitty. Also known as username
     */
    'name': string;
    'presence': ChatUserPresenceProperties;
    /**
     * Custom data associated with this user
     */
    'properties': { [key: string]: object; };
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}

export const ChatUserResourceTypeEnum = {
    Person: 'PERSON',
    Bot: 'BOT'
} as const;

export type ChatUserResourceTypeEnum = typeof ChatUserResourceTypeEnum[keyof typeof ChatUserResourceTypeEnum];
export const ChatUserResourceCallStatusEnum = {
    Available: 'AVAILABLE',
    InCall: 'IN_CALL'
} as const;

export type ChatUserResourceCallStatusEnum = typeof ChatUserResourceCallStatusEnum[keyof typeof ChatUserResourceCallStatusEnum];

/**
 * Sent when a user sends a message
 */
export interface ChatUserSentChatUserMessageNotificationData {
    'type': string;
    /**
     * The ID channel the message was sent. Deprecated: Use the channel property of this notification
     * @deprecated
     */
    'channel_id': number;
    'message': ChatUserMessageResource;
}
export interface ChatUserSessionProperties {
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * Time this session was created
     */
    'created_time': string;
    /**
     * Time this session ended. Present if state is ENDED
     */
    'end_time'?: string;
    /**
     * State of this session. ACTIVE or ENDED
     */
    'state': ChatUserSessionPropertiesStateEnum;
    'user': ChatUserProperties;
    /**
     * User agent used to start this session
     */
    'user_agent'?: string;
}

export const ChatUserSessionPropertiesStateEnum = {
    Active: 'ACTIVE',
    Ended: 'ENDED'
} as const;

export type ChatUserSessionPropertiesStateEnum = typeof ChatUserSessionPropertiesStateEnum[keyof typeof ChatUserSessionPropertiesStateEnum];

export interface ChatUserSessionResource {
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * Time this session was created
     */
    'created_time': string;
    /**
     * Time this session ended. Present if state is ENDED
     */
    'end_time'?: string;
    /**
     * State of this session. ACTIVE or ENDED
     */
    'state': ChatUserSessionResourceStateEnum;
    'user': ChatUserProperties;
    /**
     * User agent used to start this session
     */
    'user_agent'?: string;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}

export const ChatUserSessionResourceStateEnum = {
    Active: 'ACTIVE',
    Ended: 'ENDED'
} as const;

export type ChatUserSessionResourceStateEnum = typeof ChatUserSessionResourceStateEnum[keyof typeof ChatUserSessionResourceStateEnum];

/**
 * Reference to a user by username
 */
export interface ChatUserUsernameReference {
    /**
     * Username associated with this user
     */
    'username': string;
}
export interface CountResource {
    /**
     * The number of items
     */
    'count': number;
}
export interface CreateChannelGenericEventResource {
    /**
     * Custom type of this event
     */
    'type': string;
    /**
     * Custom data associated with this event
     */
    'properties': { [key: string]: object; };
}
export interface CreateChannelInviteResource {
    /**
     * Reference to a user
     */
    'user': object;
}
export interface CreateChannelResource {
    'type': string;
    /**
     * Reference to a user
     */
    'creator'?: object;
    /**
     * List of user references of members of this channel
     */
    'members'?: Set<object>;
    /**
     * Custom data associated with this channel
     */
    'properties'?: { [key: string]: object; };
}
export interface CreateChatFunctionResource {
    'type': string;
    'description'?: string;
    'initialize_asynchronously': boolean;
    'name': string;
}
export interface CreateChatFunctionVersionResource {
    /**
     * JavaScript/TypeScript code that runs when this function is executed
     */
    'handler_script': string;
}
export interface CreateDelegatedReplyThreadKeystrokesResource {
    'keys': string;
    /**
     * Reference to a user
     */
    'user': object;
}
/**
 * Creates a direct channel
 */
export interface CreateDirectChannelResource extends CreateChannelResource {
}
export interface CreateExternalFileProperties {
    /**
     * File MIME content type
     */
    'content_type': string;
    /**
     * File name
     */
    'name': string;
    /**
     * File size in bytes
     */
    'size': number;
    /**
     * External file URL
     */
    'url': string;
}
export interface CreateFileMessageResource extends CreateMessageResource {
    'file': CreateExternalFileProperties;
}
export interface CreateGroupChannelResource extends CreateChannelResource {
    /**
     * The unique name of this channel used to reference the channel. If absent defaults to a random UUID
     */
    'name'?: string;
    /**
     * Human readable name of this channel shown to users. If absent defaults to the channel name
     */
    'display_name'?: string;
}
export interface CreateMessageResource {
    'type': string;
    /**
     * Optional string to associate this message with other messages. Can be used to group messages into a gallery
     */
    'group_tag'?: string;
    /**
     * Custom data associated with this message
     */
    'properties'?: { [key: string]: object; };
    /**
     * Reference to a user
     */
    'user'?: object;
}
export interface CreatePersonChatUserResource {
    /**
     * Human readable name of this user. Shown to other users
     */
    'display_name': string;
    /**
     * True if this user was created by a guest user session
     */
    'is_guest': boolean;
    /**
     * The unique name used to identify this user across ChatKitty. Also known as username
     */
    'name': string;
    /**
     * Custom data associated with this user
     */
    'properties'?: { [key: string]: object; };
}
/**
 * Creates a private channel
 */
export interface CreatePrivateChannelResource {
    'type': string;
    /**
     * Reference to a user
     */
    'creator'?: object;
    /**
     * List of user references of members of this channel
     */
    'members'?: Set<object>;
    /**
     * Custom data associated with this channel
     */
    'properties'?: { [key: string]: object; };
    /**
     * The unique name of this channel used to reference the channel. If absent defaults to a random UUID
     */
    'name'?: string;
    /**
     * Human readable name of this channel shown to users. If absent defaults to the channel name
     */
    'display_name'?: string;
}
/**
 * Creates a public channel
 */
export interface CreatePublicChannelResource {
    'type': string;
    /**
     * Reference to a user
     */
    'creator'?: object;
    /**
     * List of user references of members of this channel
     */
    'members'?: Set<object>;
    /**
     * Custom data associated with this channel
     */
    'properties'?: { [key: string]: object; };
    /**
     * The unique name of this channel used to reference the channel. If absent defaults to a random UUID
     */
    'name'?: string;
    /**
     * Human readable name of this channel shown to users. If absent defaults to the channel name
     */
    'display_name'?: string;
}
export interface CreateTextMessageResource extends CreateMessageResource {
    /**
     * The text body of this message
     */
    'body': string;
}
export interface CursorPageMetadata {
    'next'?: string;
    'size': number;
    'start'?: string;
    'total': number;
}
export interface CursorPagedModelMessageResource {
    '_embedded'?: CursorPagedModelMessageResourceEmbedded;
    'page': CursorPageMetadata;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface CursorPagedModelMessageResourceEmbedded {
    'messages'?: Array<MessageResource>;
}
export interface CursorPagedModelNotificationResource {
    '_embedded'?: CursorPagedModelNotificationResourceEmbedded;
    'page': CursorPageMetadata;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface CursorPagedModelNotificationResourceEmbedded {
    'notifications'?: Array<NotificationResource>;
}
/**
 * Imports a direct channel
 */
export interface DirectChannelImport extends ChannelImport {
}
/**
 * A direct channel
 */
export interface DirectChannelProperties extends ChannelProperties {
    /**
     * The members of this channel. Present if this is a direct channel. For other channel types, use [**list channel messages**](https://chatkitty.com/docs/api/reference#tag/channels/operation/list-channel-messages)
     */
    'members': Array<ChatUserProperties>;
}


export interface DirectChannelResource {
    /**
     * The type of this channel
     */
    'type': DirectChannelResourceTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The ISO date-time this channel was created
     */
    'created_time': string;
    'creator'?: ChatUserProperties;
    'last_received_message'?: MessageProperties;
    /**
     * The members of this channel. Present if this is a direct channel. For other channel types, use [**list channel messages**](https://chatkitty.com/docs/api/reference#tag/channels/operation/list-channel-messages)
     */
    'members': Array<ChatUserProperties>;
    /**
     * Custom data associated with this channel
     */
    'properties': { [key: string]: object; };
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}

export const DirectChannelResourceTypeEnum = {
    Direct: 'DIRECT',
    Public: 'PUBLIC',
    Private: 'PRIVATE'
} as const;

export type DirectChannelResourceTypeEnum = typeof DirectChannelResourceTypeEnum[keyof typeof DirectChannelResourceTypeEnum];

/**
 * The emoji these users reacted with
 */
export interface EmojiProperties {
    /**
     * List of possible aliases for this emoji
     */
    'aliases': Set<string>;
    /**
     * The unicode character of this emoji
     */
    'character': string;
    /**
     * Description of this emoji
     */
    'description': string;
    /**
     * Tags used to describe this emoji
     */
    'tags': Set<string>;
}
/**
 * A file message sent by or behalf of a user
 */
export interface FileChatUserMessageProperties {
    /**
     * The type of this message
     */
    'type': FileChatUserMessagePropertiesTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The ID of the channel this message belongs to
     */
    'channel_id': number;
    /**
     * The time this message was created
     */
    'created_time': string;
    /**
     * Optional string to associate this message with other messages. Can be used to group messages into a gallery
     */
    'group_tag'?: string;
    /**
     * The time this message was last edited
     */
    'last_edited_time'?: string;
    /**
     * The nested thread level of this message
     */
    'nested_level': number;
    /**
     * Custom data associated with this message
     */
    'properties': { [key: string]: object; };
    /**
     * Reactions to this message
     */
    'reactions'?: Array<MessageReactionsSummaryProperties>;
    /**
     * The number of replies to this message
     */
    'replies_count'?: number;
    /**
     * The number of times this message has been reported
     */
    'report_count'?: number;
    'file': FileProperties;
    'user': ChatUserProperties;
}

export const FileChatUserMessagePropertiesTypeEnum = {
    Text: 'TEXT',
    File: 'FILE',
    SystemText: 'SYSTEM_TEXT',
    SystemFile: 'SYSTEM_FILE'
} as const;

export type FileChatUserMessagePropertiesTypeEnum = typeof FileChatUserMessagePropertiesTypeEnum[keyof typeof FileChatUserMessagePropertiesTypeEnum];

export interface FileChatUserMessageResource {
    /**
     * The type of this message
     */
    'type': FileChatUserMessageResourceTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The ID of the channel this message belongs to
     */
    'channel_id': number;
    /**
     * The time this message was created
     */
    'created_time': string;
    'file': FileProperties;
    /**
     * Optional string to associate this message with other messages. Can be used to group messages into a gallery
     */
    'group_tag'?: string;
    /**
     * The time this message was last edited
     */
    'last_edited_time'?: string;
    /**
     * The nested thread level of this message
     */
    'nested_level': number;
    /**
     * Custom data associated with this message
     */
    'properties': { [key: string]: object; };
    /**
     * Reactions to this message
     */
    'reactions'?: Array<MessageReactionsSummaryProperties>;
    /**
     * The number of replies to this message
     */
    'replies_count'?: number;
    /**
     * The number of times this message has been reported
     */
    'report_count'?: number;
    'user': ChatUserProperties;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}

export const FileChatUserMessageResourceTypeEnum = {
    Text: 'TEXT',
    File: 'FILE',
    SystemText: 'SYSTEM_TEXT',
    SystemFile: 'SYSTEM_FILE'
} as const;

export type FileChatUserMessageResourceTypeEnum = typeof FileChatUserMessageResourceTypeEnum[keyof typeof FileChatUserMessageResourceTypeEnum];

/**
 * External file properties
 */
export interface FileImport {
    /**
     * The mime type of this file
     */
    'content_type': string;
    /**
     * Unique value generated by the client which ChatKitty uses to recognize subsequent retries of the same request. Optional but recommended
     */
    'idempotency_key'?: string;
    /**
     * The file name
     */
    'name': string;
    /**
     * The size of this file in bytes
     */
    'size': number;
    /**
     * The file URL
     */
    'url': string;
}
export interface FileMessageProperties extends MessageProperties {
    'file': FileProperties;
}


/**
 * The file data of this message
 */
export interface FileProperties {
    /**
     * The type of this file. Either external or hosted by ChatKitty
     */
    'type': FilePropertiesTypeEnum;
    /**
     * The mime type of this file
     */
    'content_type': string;
    /**
     * The file name
     */
    'name': string;
    /**
     * The size of this file in bytes
     */
    'size': number;
    /**
     * The file URL
     */
    'url': string;
}

export const FilePropertiesTypeEnum = {
    Hosted: 'HOSTED',
    External: 'EXTERNAL'
} as const;

export type FilePropertiesTypeEnum = typeof FilePropertiesTypeEnum[keyof typeof FilePropertiesTypeEnum];

/**
 * A file message sent by this application itself. Used for systems announcements independent of any user
 */
export interface FileSystemMessageProperties {
    /**
     * The type of this message
     */
    'type': FileSystemMessagePropertiesTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The ID of the channel this message belongs to
     */
    'channel_id': number;
    /**
     * The time this message was created
     */
    'created_time': string;
    /**
     * Optional string to associate this message with other messages. Can be used to group messages into a gallery
     */
    'group_tag'?: string;
    /**
     * The time this message was last edited
     */
    'last_edited_time'?: string;
    /**
     * The nested thread level of this message
     */
    'nested_level': number;
    /**
     * Custom data associated with this message
     */
    'properties': { [key: string]: object; };
    /**
     * Reactions to this message
     */
    'reactions'?: Array<MessageReactionsSummaryProperties>;
    /**
     * The number of replies to this message
     */
    'replies_count'?: number;
    /**
     * The number of times this message has been reported
     */
    'report_count'?: number;
    'file': FileProperties;
}

export const FileSystemMessagePropertiesTypeEnum = {
    Text: 'TEXT',
    File: 'FILE',
    SystemText: 'SYSTEM_TEXT',
    SystemFile: 'SYSTEM_FILE'
} as const;

export type FileSystemMessagePropertiesTypeEnum = typeof FileSystemMessagePropertiesTypeEnum[keyof typeof FileSystemMessagePropertiesTypeEnum];

export interface FileSystemMessageResource {
    /**
     * The type of this message
     */
    'type': FileSystemMessageResourceTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The ID of the channel this message belongs to
     */
    'channel_id': number;
    /**
     * The time this message was created
     */
    'created_time': string;
    'file': FileProperties;
    /**
     * Optional string to associate this message with other messages. Can be used to group messages into a gallery
     */
    'group_tag'?: string;
    /**
     * The time this message was last edited
     */
    'last_edited_time'?: string;
    /**
     * The nested thread level of this message
     */
    'nested_level': number;
    /**
     * Custom data associated with this message
     */
    'properties': { [key: string]: object; };
    /**
     * Reactions to this message
     */
    'reactions'?: Array<MessageReactionsSummaryProperties>;
    /**
     * The number of replies to this message
     */
    'replies_count'?: number;
    /**
     * The number of times this message has been reported
     */
    'report_count'?: number;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}

export const FileSystemMessageResourceTypeEnum = {
    Text: 'TEXT',
    File: 'FILE',
    SystemText: 'SYSTEM_TEXT',
    SystemFile: 'SYSTEM_FILE'
} as const;

export type FileSystemMessageResourceTypeEnum = typeof FileSystemMessageResourceTypeEnum[keyof typeof FileSystemMessageResourceTypeEnum];

export interface GroupChannelImport {
    /**
     * Username of the user who created this channel
     */
    'creator'?: string;
    /**
     * Human readable name of this channel shown to users. If absent defaults to the channel name
     */
    'display_name'?: string;
    /**
     * Unique value generated by the client which ChatKitty uses to recognize subsequent retries of the same request. Optional but recommended
     */
    'idempotency_key'?: string;
    /**
     * List of usernames of members of this channel
     */
    'members': Array<string>;
    /**
     * The unique name of this channel used to reference the channel. If absent defaults to a random UUID
     */
    'name'?: string;
    /**
     * Custom data associated with this channel
     */
    'properties'?: { [key: string]: object; };
}
export interface GroupChannelProperties extends ChannelProperties {
    /**
     * Human readable name of this channel shown to users
     */
    'display_name': string;
    /**
     * The unique name of this channel used to reference the channel
     */
    'name': string;
}


export interface Link {
    'href'?: string;
    'hreflang'?: string;
    'title'?: string;
    'type'?: string;
    'deprecation'?: string;
    'profile'?: string;
    'name'?: string;
    'templated'?: boolean;
}
export interface MessageImport {
    'type': string;
    /**
     * ID of the channel this message belongs to
     */
    'channel_id': number;
    /**
     * Tag identifying the message group this message belongs to
     */
    'group_tag'?: string;
    /**
     * Unique value generated by the client which ChatKitty uses to recognize subsequent retries of the same request. Optional but recommended
     */
    'idempotency_key'?: string;
    /**
     * Map of custom data attached to this message
     */
    'properties'?: { [key: string]: object; };
}
/**
 * Image data of this link preview
 */
export interface MessageLinkPreviewImageProperties {
    /**
     * The url source of this image
     */
    'source': string;
}
/**
 * Embedded link preview data
 */
export interface MessageLinkPreviewProperties {
    /**
     * Description of this link preview
     */
    'description'?: string;
    'image': MessageLinkPreviewImageProperties;
    /**
     * The name of the site linked
     */
    'site_name'?: string;
    /**
     * The title of this link
     */
    'title': string;
    /**
     * The URL of the link being previewed
     */
    'url': string;
}
/**
 * Link previews in this message
 */
export interface MessageLinkProperties {
    /**
     * The ending index of this link within the message
     */
    'end_position': number;
    'preview'?: MessageLinkPreviewProperties;
    /**
     * The href of the URL this message link represents
     */
    'source': string;
    /**
     * The starting index of this link within the message
     */
    'start_position': number;
}
/**
 * Channel properties embedded in channel mentions
 */
export interface MessageMentionChannelProperties {
    /**
     * The type of this channel
     */
    'type': MessageMentionChannelPropertiesTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The ISO date-time this channel was created
     */
    'created_time': string;
    'creator'?: ChatUserProperties;
    /**
     * Human readable name of this channel shown to users. Present if this is a group channel
     */
    'display_name'?: string;
    /**
     * The unique name of this channel used to reference the channel. Present if this is a group channel
     */
    'name'?: string;
    /**
     * Custom data associated with this channel
     */
    'properties': { [key: string]: object; };
}

export const MessageMentionChannelPropertiesTypeEnum = {
    Direct: 'DIRECT',
    Public: 'PUBLIC',
    Private: 'PRIVATE'
} as const;

export type MessageMentionChannelPropertiesTypeEnum = typeof MessageMentionChannelPropertiesTypeEnum[keyof typeof MessageMentionChannelPropertiesTypeEnum];

/**
 * Mentions in this message
 */
export interface MessageMentionProperties {
    /**
     * The type of this message mention
     */
    'type': MessageMentionPropertiesTypeEnum;
    /**
     * The ending position of this mention reference inside its message
     */
    'end_position': number;
    /**
     * The starting position of this mention reference inside its message
     */
    'start_position': number;
    /**
     * The literal text referencing the mentioned entity inside the message
     */
    'tag': string;
}

export const MessageMentionPropertiesTypeEnum = {
    Channel: 'CHANNEL',
    User: 'USER'
} as const;

export type MessageMentionPropertiesTypeEnum = typeof MessageMentionPropertiesTypeEnum[keyof typeof MessageMentionPropertiesTypeEnum];

export interface MessageProperties {
    /**
     * The type of this message
     */
    'type': MessagePropertiesTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The ID of the channel this message belongs to
     */
    'channel_id': number;
    /**
     * The time this message was created
     */
    'created_time': string;
    /**
     * Optional string to associate this message with other messages. Can be used to group messages into a gallery
     */
    'group_tag'?: string;
    /**
     * The time this message was last edited
     */
    'last_edited_time'?: string;
    /**
     * The nested thread level of this message
     */
    'nested_level': number;
    /**
     * Custom data associated with this message
     */
    'properties': { [key: string]: object; };
    /**
     * Reactions to this message
     */
    'reactions'?: Array<MessageReactionsSummaryProperties>;
    /**
     * The number of replies to this message
     */
    'replies_count'?: number;
    /**
     * The number of times this message has been reported
     */
    'report_count'?: number;
}

export const MessagePropertiesTypeEnum = {
    Text: 'TEXT',
    File: 'FILE',
    SystemText: 'SYSTEM_TEXT',
    SystemFile: 'SYSTEM_FILE'
} as const;

export type MessagePropertiesTypeEnum = typeof MessagePropertiesTypeEnum[keyof typeof MessagePropertiesTypeEnum];

/**
 * Reactions to this message
 */
export interface MessageReactionsSummaryProperties {
    /**
     * The number of users that reacted with this emoji
     */
    'count': number;
    'emoji': EmojiProperties;
    /**
     * The users that reacted with this emoji
     */
    'users': Array<ChatUserProperties>;
}
export interface MessageReadReceiptResource {
    /**
     * Time the user read this message
     */
    'created_time': string;
    'user': ChatUserProperties;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface MessageReadReceiptSummaryResource {
    'channel': ChannelProperties;
    /**
     * Number of unread messages
     */
    'count': number;
    'user': ChatUserProperties;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
/**
 * @type MessageResource
 */
export type MessageResource = { type: 'FILE' } & FileChatUserMessageResource | { type: 'SYSTEM_FILE' } & FileSystemMessageResource | { type: 'SYSTEM_TEXT' } & TextSystemMessageResource | { type: 'TEXT' } & TextChatUserMessageResource;

/**
 * Additional context data of this notification
 */
export interface NotificationData {
    /**
     * The type of notification that was received. This specifies the schema of the notification data
     */
    'type': string;
}
export interface NotificationResource {
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The text body of this notification
     */
    'body': string;
    'channel'?: ChannelProperties;
    /**
     * Time this notification was created
     */
    'created_time': string;
    'data': NotificationData;
    /**
     * True if this notification should be muted
     */
    'muted': boolean;
    /**
     * Time this notification was read
     */
    'read_time'?: string;
    /**
     * The title of this notification
     */
    'title': string;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface PageMetadata {
    'number'?: number;
    'size'?: number;
    'total_elements'?: number;
    'total_pages'?: number;
}
export interface Pageable {
    'page'?: number;
    'size'?: number;
    'sort'?: Array<string>;
}
export interface PagedModelApplicationJobResource {
    '_embedded'?: PagedModelApplicationJobResourceEmbedded;
    'page'?: PageMetadata;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface PagedModelApplicationJobResourceEmbedded {
    'jobs'?: Array<ApplicationJobResource>;
}
export interface PagedModelChannelInviteResource {
    '_embedded'?: PagedModelChannelInviteResourceEmbedded;
    'page'?: PageMetadata;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface PagedModelChannelInviteResourceEmbedded {
    'invites'?: Array<ChannelInviteResource>;
}
export interface PagedModelChannelMembershipResource {
    '_embedded'?: PagedModelChannelMembershipResourceEmbedded;
    'page'?: PageMetadata;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface PagedModelChannelMembershipResourceEmbedded {
    'memberships'?: Array<ChannelMembershipResource>;
}
export interface PagedModelChannelResource {
    '_embedded'?: PagedModelChannelResourceEmbedded;
    'page'?: PageMetadata;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface PagedModelChannelResourceEmbedded {
    'channels'?: Array<ChannelResource>;
}
export interface PagedModelChatFunctionInvocationResource {
    '_embedded'?: PagedModelChatFunctionInvocationResourceEmbedded;
    'page'?: PageMetadata;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface PagedModelChatFunctionInvocationResourceEmbedded {
    'invocations'?: Array<ChatFunctionInvocationResource>;
}
export interface PagedModelChatFunctionResource {
    '_embedded'?: PagedModelChatFunctionResourceEmbedded;
    'page'?: PageMetadata;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface PagedModelChatFunctionResourceEmbedded {
    'functions'?: Array<ChatFunctionResource>;
}
export interface PagedModelChatFunctionVersionResource {
    '_embedded'?: PagedModelChatFunctionVersionResourceEmbedded;
    'page'?: PageMetadata;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface PagedModelChatFunctionVersionResourceEmbedded {
    'versions'?: Array<ChatFunctionVersionResource>;
}
export interface PagedModelChatSessionResource {
    '_embedded'?: PagedModelChatSessionResourceEmbedded;
    'page'?: PageMetadata;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface PagedModelChatSessionResourceEmbedded {
    'sessions'?: Array<ChatSessionResource>;
}
export interface PagedModelChatUserResource {
    '_embedded'?: PagedModelChatUserResourceEmbedded;
    'page'?: PageMetadata;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface PagedModelChatUserResourceEmbedded {
    'users'?: Array<ChatUserResource>;
}
export interface PagedModelChatUserSessionResource {
    '_embedded'?: PagedModelChatUserSessionResourceEmbedded;
    'page'?: PageMetadata;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface PagedModelChatUserSessionResourceEmbedded {
    'sessions'?: Array<ChatUserSessionResource>;
}
export interface PagedModelMessageReadReceiptResource {
    '_embedded'?: PagedModelMessageReadReceiptResourceEmbedded;
    'page'?: PageMetadata;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface PagedModelMessageReadReceiptResourceEmbedded {
    'receipts'?: Array<MessageReadReceiptResource>;
}
export interface PagedModelMessageReadReceiptSummaryResource {
    '_embedded'?: PagedModelMessageReadReceiptSummaryResourceEmbedded;
    'page'?: PageMetadata;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface PagedModelMessageReadReceiptSummaryResourceEmbedded {
    'summaries'?: Array<MessageReadReceiptSummaryResource>;
}
export interface PagedModelMessageResource {
    '_embedded'?: CursorPagedModelMessageResourceEmbedded;
    'page'?: PageMetadata;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
/**
 * Imports a private channel
 */
export interface PrivateChannelImport extends ChannelImport {
    /**
     * The unique name of this channel used to reference the channel. If absent defaults to a random UUID
     */
    'name'?: string;
    /**
     * Human readable name of this channel shown to users. If absent defaults to the channel name
     */
    'display_name'?: string;
}
/**
 * A private channel
 */
export interface PrivateChannelProperties {
    /**
     * The type of this channel
     */
    'type': PrivateChannelPropertiesTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The ISO date-time this channel was created
     */
    'created_time': string;
    'creator'?: ChatUserProperties;
    'last_received_message'?: MessageProperties;
    /**
     * Custom data associated with this channel
     */
    'properties': { [key: string]: object; };
    /**
     * Human readable name of this channel shown to users
     */
    'display_name': string;
    /**
     * The unique name of this channel used to reference the channel
     */
    'name': string;
}

export const PrivateChannelPropertiesTypeEnum = {
    Direct: 'DIRECT',
    Public: 'PUBLIC',
    Private: 'PRIVATE'
} as const;

export type PrivateChannelPropertiesTypeEnum = typeof PrivateChannelPropertiesTypeEnum[keyof typeof PrivateChannelPropertiesTypeEnum];

export interface PrivateChannelResource {
    /**
     * The type of this channel
     */
    'type': PrivateChannelResourceTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The ISO date-time this channel was created
     */
    'created_time': string;
    'creator'?: ChatUserProperties;
    /**
     * Human readable name of this channel shown to users
     */
    'display_name': string;
    'last_received_message'?: MessageProperties;
    /**
     * The unique name of this channel used to reference the channel
     */
    'name': string;
    /**
     * Custom data associated with this channel
     */
    'properties': { [key: string]: object; };
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}

export const PrivateChannelResourceTypeEnum = {
    Direct: 'DIRECT',
    Public: 'PUBLIC',
    Private: 'PRIVATE'
} as const;

export type PrivateChannelResourceTypeEnum = typeof PrivateChannelResourceTypeEnum[keyof typeof PrivateChannelResourceTypeEnum];

/**
 * Imports a public channel
 */
export interface PublicChannelImport extends ChannelImport {
    /**
     * The unique name of this channel used to reference the channel. If absent defaults to a random UUID
     */
    'name'?: string;
    /**
     * Human readable name of this channel shown to users. If absent defaults to the channel name
     */
    'display_name'?: string;
}
/**
 * A public channel
 */
export interface PublicChannelProperties {
    /**
     * The type of this channel
     */
    'type': PublicChannelPropertiesTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The ISO date-time this channel was created
     */
    'created_time': string;
    'creator'?: ChatUserProperties;
    'last_received_message'?: MessageProperties;
    /**
     * Custom data associated with this channel
     */
    'properties': { [key: string]: object; };
    /**
     * Human readable name of this channel shown to users
     */
    'display_name': string;
    /**
     * The unique name of this channel used to reference the channel
     */
    'name': string;
}

export const PublicChannelPropertiesTypeEnum = {
    Direct: 'DIRECT',
    Public: 'PUBLIC',
    Private: 'PRIVATE'
} as const;

export type PublicChannelPropertiesTypeEnum = typeof PublicChannelPropertiesTypeEnum[keyof typeof PublicChannelPropertiesTypeEnum];

export interface PublicChannelResource {
    /**
     * The type of this channel
     */
    'type': PublicChannelResourceTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The ISO date-time this channel was created
     */
    'created_time': string;
    'creator'?: ChatUserProperties;
    /**
     * Human readable name of this channel shown to users
     */
    'display_name': string;
    'last_received_message'?: MessageProperties;
    /**
     * The unique name of this channel used to reference the channel
     */
    'name': string;
    /**
     * Custom data associated with this channel
     */
    'properties': { [key: string]: object; };
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}

export const PublicChannelResourceTypeEnum = {
    Direct: 'DIRECT',
    Public: 'PUBLIC',
    Private: 'PRIVATE'
} as const;

export type PublicChannelResourceTypeEnum = typeof PublicChannelResourceTypeEnum[keyof typeof PublicChannelResourceTypeEnum];

export interface ReplyThreadKeystrokesResource {
    'keys': string;
    'username': string;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}
export interface ReplyThreadResource {
    /**
     * The type of this thread
     */
    'type': ReplyThreadResourceTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The ISO date-time this thread was created
     */
    'created_time': string;
    /**
     * The name of this thread
     */
    'name'?: string;
    /**
     * Custom data associated with this thread
     */
    'properties': { [key: string]: object; };
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}

export const ReplyThreadResourceTypeEnum = {
    Main: 'MAIN',
    Standalone: 'STANDALONE',
    Message: 'MESSAGE'
} as const;

export type ReplyThreadResourceTypeEnum = typeof ReplyThreadResourceTypeEnum[keyof typeof ReplyThreadResourceTypeEnum];

export interface SecretResource {
    /**
     * Secret value
     */
    'secret'?: object;
}
/**
 * @type SystemMessageResource
 * The message that was sent
 */
export type SystemMessageResource = { type: 'SYSTEM_FILE' } & FileSystemMessageResource | { type: 'SYSTEM_TEXT' } & TextSystemMessageResource;

/**
 * Imports a user text message
 */
export interface TextChatUserMessageImport extends MessageImport {
    /**
     * The text body of this message
     */
    'body': string;
    /**
     * Username of the user who sent this message
     */
    'user': string;
}
/**
 * A text message sent by or behalf of a user
 */
export interface TextChatUserMessageProperties {
    /**
     * The type of this message
     */
    'type': TextChatUserMessagePropertiesTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The ID of the channel this message belongs to
     */
    'channel_id': number;
    /**
     * The time this message was created
     */
    'created_time': string;
    /**
     * Optional string to associate this message with other messages. Can be used to group messages into a gallery
     */
    'group_tag'?: string;
    /**
     * The time this message was last edited
     */
    'last_edited_time'?: string;
    /**
     * The nested thread level of this message
     */
    'nested_level': number;
    /**
     * Custom data associated with this message
     */
    'properties': { [key: string]: object; };
    /**
     * Reactions to this message
     */
    'reactions'?: Array<MessageReactionsSummaryProperties>;
    /**
     * The number of replies to this message
     */
    'replies_count'?: number;
    /**
     * The number of times this message has been reported
     */
    'report_count'?: number;
    /**
     * The text body of this message
     */
    'body': string;
    /**
     * Link previews in this message
     */
    'links'?: Array<MessageLinkProperties>;
    /**
     * Mentions in this message
     */
    'mentions'?: Array<MessageMentionProperties>;
    'user': ChatUserProperties;
}

export const TextChatUserMessagePropertiesTypeEnum = {
    Text: 'TEXT',
    File: 'FILE',
    SystemText: 'SYSTEM_TEXT',
    SystemFile: 'SYSTEM_FILE'
} as const;

export type TextChatUserMessagePropertiesTypeEnum = typeof TextChatUserMessagePropertiesTypeEnum[keyof typeof TextChatUserMessagePropertiesTypeEnum];

export interface TextChatUserMessageResource {
    /**
     * The type of this message
     */
    'type': TextChatUserMessageResourceTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The text body of this message
     */
    'body': string;
    /**
     * The ID of the channel this message belongs to
     */
    'channel_id': number;
    /**
     * The time this message was created
     */
    'created_time': string;
    /**
     * Optional string to associate this message with other messages. Can be used to group messages into a gallery
     */
    'group_tag'?: string;
    /**
     * The time this message was last edited
     */
    'last_edited_time'?: string;
    /**
     * Link previews in this message
     */
    'links'?: Array<MessageLinkProperties>;
    /**
     * Mentions in this message
     */
    'mentions'?: Array<MessageMentionProperties>;
    /**
     * The nested thread level of this message
     */
    'nested_level': number;
    /**
     * Custom data associated with this message
     */
    'properties': { [key: string]: object; };
    /**
     * Reactions to this message
     */
    'reactions'?: Array<MessageReactionsSummaryProperties>;
    /**
     * The number of replies to this message
     */
    'replies_count'?: number;
    /**
     * The number of times this message has been reported
     */
    'report_count'?: number;
    'user': ChatUserProperties;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}

export const TextChatUserMessageResourceTypeEnum = {
    Text: 'TEXT',
    File: 'FILE',
    SystemText: 'SYSTEM_TEXT',
    SystemFile: 'SYSTEM_FILE'
} as const;

export type TextChatUserMessageResourceTypeEnum = typeof TextChatUserMessageResourceTypeEnum[keyof typeof TextChatUserMessageResourceTypeEnum];

export interface TextMessageImport {
    /**
     * The text body of this message
     */
    'body': string;
    /**
     * ID of the channel this message belongs to
     */
    'channel_id': number;
    /**
     * Tag identifying the message group this message belongs to
     */
    'group_tag'?: string;
    /**
     * Unique value generated by the client which ChatKitty uses to recognize subsequent retries of the same request. Optional but recommended
     */
    'idempotency_key'?: string;
    /**
     * Map of custom data attached to this message
     */
    'properties'?: { [key: string]: object; };
}
export interface TextMessageProperties extends MessageProperties {
    /**
     * The text body of this message
     */
    'body': string;
    /**
     * Link previews in this message
     */
    'links'?: Array<MessageLinkProperties>;
    /**
     * Mentions in this message
     */
    'mentions'?: Array<MessageMentionProperties>;
}


/**
 * @type TextMessageResource
 * The message in which the user was mentioned
 */
export type TextMessageResource = { type: 'SYSTEM_TEXT' } & TextSystemMessageResource | { type: 'TEXT' } & TextChatUserMessageResource;

/**
 * Imports a system text message
 */
export interface TextSystemMessageImport extends MessageImport {
    /**
     * The text body of this message
     */
    'body': string;
}
/**
 * A text message sent by this application itself. Used for systems announcements independent of any user
 */
export interface TextSystemMessageProperties {
    /**
     * The type of this message
     */
    'type': TextSystemMessagePropertiesTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The ID of the channel this message belongs to
     */
    'channel_id': number;
    /**
     * The time this message was created
     */
    'created_time': string;
    /**
     * Optional string to associate this message with other messages. Can be used to group messages into a gallery
     */
    'group_tag'?: string;
    /**
     * The time this message was last edited
     */
    'last_edited_time'?: string;
    /**
     * The nested thread level of this message
     */
    'nested_level': number;
    /**
     * Custom data associated with this message
     */
    'properties': { [key: string]: object; };
    /**
     * Reactions to this message
     */
    'reactions'?: Array<MessageReactionsSummaryProperties>;
    /**
     * The number of replies to this message
     */
    'replies_count'?: number;
    /**
     * The number of times this message has been reported
     */
    'report_count'?: number;
    /**
     * The text body of this message
     */
    'body': string;
    /**
     * Link previews in this message
     */
    'links'?: Array<MessageLinkProperties>;
    /**
     * Mentions in this message
     */
    'mentions'?: Array<MessageMentionProperties>;
}

export const TextSystemMessagePropertiesTypeEnum = {
    Text: 'TEXT',
    File: 'FILE',
    SystemText: 'SYSTEM_TEXT',
    SystemFile: 'SYSTEM_FILE'
} as const;

export type TextSystemMessagePropertiesTypeEnum = typeof TextSystemMessagePropertiesTypeEnum[keyof typeof TextSystemMessagePropertiesTypeEnum];

export interface TextSystemMessageResource {
    /**
     * The type of this message
     */
    'type': TextSystemMessageResourceTypeEnum;
    /**
     * 64-bit integer identifier associated with this resource
     */
    'id': number;
    /**
     * The text body of this message
     */
    'body': string;
    /**
     * The ID of the channel this message belongs to
     */
    'channel_id': number;
    /**
     * The time this message was created
     */
    'created_time': string;
    /**
     * Optional string to associate this message with other messages. Can be used to group messages into a gallery
     */
    'group_tag'?: string;
    /**
     * The time this message was last edited
     */
    'last_edited_time'?: string;
    /**
     * Link previews in this message
     */
    'links'?: Array<MessageLinkProperties>;
    /**
     * Mentions in this message
     */
    'mentions'?: Array<MessageMentionProperties>;
    /**
     * The nested thread level of this message
     */
    'nested_level': number;
    /**
     * Custom data associated with this message
     */
    'properties': { [key: string]: object; };
    /**
     * Reactions to this message
     */
    'reactions'?: Array<MessageReactionsSummaryProperties>;
    /**
     * The number of replies to this message
     */
    'replies_count'?: number;
    /**
     * The number of times this message has been reported
     */
    'report_count'?: number;
    /**
     * Hypermedia control links for this resource
     */
    '_links'?: Array<Link>;
}

export const TextSystemMessageResourceTypeEnum = {
    Text: 'TEXT',
    File: 'FILE',
    SystemText: 'SYSTEM_TEXT',
    SystemFile: 'SYSTEM_FILE'
} as const;

export type TextSystemMessageResourceTypeEnum = typeof TextSystemMessageResourceTypeEnum[keyof typeof TextSystemMessageResourceTypeEnum];


/**
 * AnalyticsApi - axios parameter creator
 */
export const AnalyticsApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Batch export message analytics data
         * @summary Export message analytics
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        exportMessageAnalytics: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/analytics/messages`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Batch export user analytics data
         * @summary Export user analytics
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        exportUserAnalytics: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/analytics/users`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * AnalyticsApi - functional programming interface
 */
export const AnalyticsApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = AnalyticsApiAxiosParamCreator(configuration)
    return {
        /**
         * Batch export message analytics data
         * @summary Export message analytics
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async exportMessageAnalytics(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApplicationJobResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.exportMessageAnalytics(options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AnalyticsApi.exportMessageAnalytics']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Batch export user analytics data
         * @summary Export user analytics
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async exportUserAnalytics(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApplicationJobResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.exportUserAnalytics(options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AnalyticsApi.exportUserAnalytics']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * AnalyticsApi - factory interface
 */
export const AnalyticsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = AnalyticsApiFp(configuration)
    return {
        /**
         * Batch export message analytics data
         * @summary Export message analytics
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        exportMessageAnalytics(options?: RawAxiosRequestConfig): AxiosPromise<ApplicationJobResource> {
            return localVarFp.exportMessageAnalytics(options).then((request) => request(axios, basePath));
        },
        /**
         * Batch export user analytics data
         * @summary Export user analytics
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        exportUserAnalytics(options?: RawAxiosRequestConfig): AxiosPromise<ApplicationJobResource> {
            return localVarFp.exportUserAnalytics(options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * AnalyticsApi - object-oriented interface
 */
export class AnalyticsApi extends BaseAPI {
    /**
     * Batch export message analytics data
     * @summary Export message analytics
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public exportMessageAnalytics(options?: RawAxiosRequestConfig) {
        return AnalyticsApiFp(this.configuration).exportMessageAnalytics(options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Batch export user analytics data
     * @summary Export user analytics
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public exportUserAnalytics(options?: RawAxiosRequestConfig) {
        return AnalyticsApiFp(this.configuration).exportUserAnalytics(options).then((request) => request(this.axios, this.basePath));
    }
}



/**
 * ApplicationApi - axios parameter creator
 */
export const ApplicationApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Returns the ChatKitty application associated with the authentication credentials used.  You must use an **OAuth V2 Bearer token** to access this endpoint.
         * @summary Retrieve the authenticated application
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveApplication: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/application`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns the message read receipt summaries for the authenticated application
         * @summary Retrieve the authenticated application message read receipt summaries
         * @param {Pageable} pageable 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveApplicationMessageReadReceiptSummaries: async (pageable: Pageable, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'pageable' is not null or undefined
            assertParamExists('retrieveApplicationMessageReadReceiptSummaries', 'pageable', pageable)
            const localVarPath = `/application/message-read-receipt-summaries`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (pageable !== undefined) {
                for (const [key, value] of Object.entries(pageable)) {
                    localVarQueryParameter[key] = value;
                }
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns the current settings configuring this application
         * @summary Retrieve the authenticated application settings
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveApplicationSettings: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/application/settings`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Update the settings configuring this application
         * @summary Update the authenticated application settings
         * @param {ApplicationSettingsResource} applicationSettingsResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateApplicationSettings: async (applicationSettingsResource: ApplicationSettingsResource, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'applicationSettingsResource' is not null or undefined
            assertParamExists('updateApplicationSettings', 'applicationSettingsResource', applicationSettingsResource)
            const localVarPath = `/application/settings`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/vnd.chatkitty+json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(applicationSettingsResource, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * ApplicationApi - functional programming interface
 */
export const ApplicationApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = ApplicationApiAxiosParamCreator(configuration)
    return {
        /**
         * Returns the ChatKitty application associated with the authentication credentials used.  You must use an **OAuth V2 Bearer token** to access this endpoint.
         * @summary Retrieve the authenticated application
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveApplication(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApplicationResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveApplication(options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ApplicationApi.retrieveApplication']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns the message read receipt summaries for the authenticated application
         * @summary Retrieve the authenticated application message read receipt summaries
         * @param {Pageable} pageable 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveApplicationMessageReadReceiptSummaries(pageable: Pageable, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelMessageReadReceiptSummaryResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveApplicationMessageReadReceiptSummaries(pageable, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ApplicationApi.retrieveApplicationMessageReadReceiptSummaries']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns the current settings configuring this application
         * @summary Retrieve the authenticated application settings
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveApplicationSettings(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApplicationSettingsResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveApplicationSettings(options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ApplicationApi.retrieveApplicationSettings']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Update the settings configuring this application
         * @summary Update the authenticated application settings
         * @param {ApplicationSettingsResource} applicationSettingsResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateApplicationSettings(applicationSettingsResource: ApplicationSettingsResource, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApplicationSettingsResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateApplicationSettings(applicationSettingsResource, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ApplicationApi.updateApplicationSettings']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * ApplicationApi - factory interface
 */
export const ApplicationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = ApplicationApiFp(configuration)
    return {
        /**
         * Returns the ChatKitty application associated with the authentication credentials used.  You must use an **OAuth V2 Bearer token** to access this endpoint.
         * @summary Retrieve the authenticated application
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveApplication(options?: RawAxiosRequestConfig): AxiosPromise<ApplicationResource> {
            return localVarFp.retrieveApplication(options).then((request) => request(axios, basePath));
        },
        /**
         * Returns the message read receipt summaries for the authenticated application
         * @summary Retrieve the authenticated application message read receipt summaries
         * @param {Pageable} pageable 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveApplicationMessageReadReceiptSummaries(pageable: Pageable, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelMessageReadReceiptSummaryResource> {
            return localVarFp.retrieveApplicationMessageReadReceiptSummaries(pageable, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns the current settings configuring this application
         * @summary Retrieve the authenticated application settings
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveApplicationSettings(options?: RawAxiosRequestConfig): AxiosPromise<ApplicationSettingsResource> {
            return localVarFp.retrieveApplicationSettings(options).then((request) => request(axios, basePath));
        },
        /**
         * Update the settings configuring this application
         * @summary Update the authenticated application settings
         * @param {ApplicationSettingsResource} applicationSettingsResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateApplicationSettings(applicationSettingsResource: ApplicationSettingsResource, options?: RawAxiosRequestConfig): AxiosPromise<ApplicationSettingsResource> {
            return localVarFp.updateApplicationSettings(applicationSettingsResource, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * ApplicationApi - object-oriented interface
 */
export class ApplicationApi extends BaseAPI {
    /**
     * Returns the ChatKitty application associated with the authentication credentials used.  You must use an **OAuth V2 Bearer token** to access this endpoint.
     * @summary Retrieve the authenticated application
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveApplication(options?: RawAxiosRequestConfig) {
        return ApplicationApiFp(this.configuration).retrieveApplication(options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns the message read receipt summaries for the authenticated application
     * @summary Retrieve the authenticated application message read receipt summaries
     * @param {Pageable} pageable 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveApplicationMessageReadReceiptSummaries(pageable: Pageable, options?: RawAxiosRequestConfig) {
        return ApplicationApiFp(this.configuration).retrieveApplicationMessageReadReceiptSummaries(pageable, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns the current settings configuring this application
     * @summary Retrieve the authenticated application settings
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveApplicationSettings(options?: RawAxiosRequestConfig) {
        return ApplicationApiFp(this.configuration).retrieveApplicationSettings(options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Update the settings configuring this application
     * @summary Update the authenticated application settings
     * @param {ApplicationSettingsResource} applicationSettingsResource 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public updateApplicationSettings(applicationSettingsResource: ApplicationSettingsResource, options?: RawAxiosRequestConfig) {
        return ApplicationApiFp(this.configuration).updateApplicationSettings(applicationSettingsResource, options).then((request) => request(this.axios, this.basePath));
    }
}



/**
 * ChannelsApi - axios parameter creator
 */
export const ChannelsApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Makes a user a group channel member
         * @summary Add a channel member
         * @param {number} id Channel ID
         * @param {object} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        addChannelMember: async (id: number, body: object, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('addChannelMember', 'id', id)
            // verify required parameter 'body' is not null or undefined
            assertParamExists('addChannelMember', 'body', body)
            const localVarPath = `/channels/{id}/members`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/vnd.chatkitty+json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Makes a user a group channel moderator
         * @summary Add a channel moderator
         * @param {number} id Channel ID
         * @param {object} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        addChannelModerator: async (id: number, body: object, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('addChannelModerator', 'id', id)
            // verify required parameter 'body' is not null or undefined
            assertParamExists('addChannelModerator', 'body', body)
            const localVarPath = `/channels/{id}/moderators`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/vnd.chatkitty+json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Creates a new channel or returns an equivalent existing channel
         * @summary Create a channel
         * @param {CreateChannelResource} createChannelResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createChannel: async (createChannelResource: CreateChannelResource, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'createChannelResource' is not null or undefined
            assertParamExists('createChannel', 'createChannelResource', createChannelResource)
            const localVarPath = `/channels`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/vnd.chatkitty+json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(createChannelResource, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Deletes a channel by ID
         * @summary Delete a channel
         * @param {number} id Channel ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteChannel: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('deleteChannel', 'id', id)
            const localVarPath = `/channels/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of invites sent to join this channel
         * @summary List channel invites
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannelInvites: async (id: number, page?: number, size?: number, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listChannelInvites', 'id', id)
            const localVarPath = `/channels/{id}/invites`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of channel members
         * @summary List a channel\'s members
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannelMembers: async (id: number, page?: number, size?: number, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listChannelMembers', 'id', id)
            const localVarPath = `/channels/{id}/members`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of channel membership info for this channel
         * @summary List channel memberships
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannelMemberships: async (id: number, page?: number, size?: number, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listChannelMemberships', 'id', id)
            const localVarPath = `/channels/{id}/memberships`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of messages sent in this channel
         * @summary List channel messages
         * @param {number} id Channel ID
         * @param {number} [size] The size of the page to be returned
         * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
         * @param {ListChannelMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {string} [username] 
         * @param {string} [query] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannelMessages: async (id: number, size?: number, start?: number, next?: number, relation?: ListChannelMessagesRelationEnum, username?: string, query?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listChannelMessages', 'id', id)
            const localVarPath = `/channels/{id}/messages`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (start !== undefined) {
                localVarQueryParameter['start'] = start;
            }

            if (next !== undefined) {
                localVarQueryParameter['next'] = next;
            }

            if (relation !== undefined) {
                localVarQueryParameter['relation'] = relation;
            }

            if (username !== undefined) {
                localVarQueryParameter['username'] = username;
            }

            if (query !== undefined) {
                localVarQueryParameter['query'] = query;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of channel moderators
         * @summary Lists a channel\'s moderators
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannelModerators: async (id: number, page?: number, size?: number, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listChannelModerators', 'id', id)
            const localVarPath = `/channels/{id}/moderators`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of channel active participants: members that currently online
         * @summary List channel participants
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannelParticipants: async (id: number, page?: number, size?: number, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listChannelParticipants', 'id', id)
            const localVarPath = `/channels/{id}/participants`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of reported messages in this channel
         * @summary List channel reported messages
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannelReportedMessages: async (id: number, page?: number, size?: number, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listChannelReportedMessages', 'id', id)
            const localVarPath = `/channels/{id}/reported-messages`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of channels belonging to this application
         * @summary List channels
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {ListChannelsTypeEnum} [type] Filters by channel type
         * @param {Set<string>} [members] Filters by channel members using their usernames
         * @param {string} [startTime] Filters for channels created within a time range: start time
         * @param {string} [endTime] Filters for channels created within a time range: end time
         * @param {string} [properties] Filters by channel custom properties
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannels: async (page?: number, size?: number, sort?: Array<string>, type?: ListChannelsTypeEnum, members?: Set<string>, startTime?: string, endTime?: string, properties?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/channels`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }

            if (type !== undefined) {
                localVarQueryParameter['type'] = type;
            }

            if (members) {
                localVarQueryParameter['members'] = Array.from(members);
            }

            if (startTime !== undefined) {
                localVarQueryParameter['startTime'] = (startTime as any instanceof Date) ?
                    (startTime as any).toISOString() :
                    startTime;
            }

            if (endTime !== undefined) {
                localVarQueryParameter['endTime'] = (endTime as any instanceof Date) ?
                    (endTime as any).toISOString() :
                    endTime;
            }

            if (properties !== undefined) {
                localVarQueryParameter['properties'] = properties;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Removes a member from a group channel
         * @summary Remove a channel member
         * @param {number} id Channel ID
         * @param {number} userId User ID of member to be removed
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        removeChannelMember: async (id: number, userId: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('removeChannelMember', 'id', id)
            // verify required parameter 'userId' is not null or undefined
            assertParamExists('removeChannelMember', 'userId', userId)
            const localVarPath = `/channels/{id}/members/{user_id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)))
                .replace(`{${"user_id"}}`, encodeURIComponent(String(userId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Removes a moderator from a group channel
         * @summary Remove a channel moderator
         * @param {number} id Channel ID
         * @param {number} userId User ID of moderator to be removed
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        removeChannelModerator: async (id: number, userId: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('removeChannelModerator', 'id', id)
            // verify required parameter 'userId' is not null or undefined
            assertParamExists('removeChannelModerator', 'userId', userId)
            const localVarPath = `/channels/{id}/moderators/{user_id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)))
                .replace(`{${"user_id"}}`, encodeURIComponent(String(userId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a channel by ID
         * @summary Retrieve a channel
         * @param {number} id Channel ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveChannel: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('retrieveChannel', 'id', id)
            const localVarPath = `/channels/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Sends a custom channel event
         * @summary Send a channel event
         * @param {number} id Channel ID
         * @param {CreateChannelGenericEventResource} createChannelGenericEventResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendChannelEvent: async (id: number, createChannelGenericEventResource: CreateChannelGenericEventResource, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('sendChannelEvent', 'id', id)
            // verify required parameter 'createChannelGenericEventResource' is not null or undefined
            assertParamExists('sendChannelEvent', 'createChannelGenericEventResource', createChannelGenericEventResource)
            const localVarPath = `/channels/{id}/events`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/vnd.chatkitty+json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(createChannelGenericEventResource, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Sends a channel invite to user
         * @summary Send a channel invite
         * @param {number} id Channel ID
         * @param {CreateChannelInviteResource} createChannelInviteResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendChannelInvite: async (id: number, createChannelInviteResource: CreateChannelInviteResource, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('sendChannelInvite', 'id', id)
            // verify required parameter 'createChannelInviteResource' is not null or undefined
            assertParamExists('sendChannelInvite', 'createChannelInviteResource', createChannelInviteResource)
            const localVarPath = `/channels/{id}/invites`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/vnd.chatkitty+json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(createChannelInviteResource, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Sends keystrokes in this channel on behalf of a user
         * @summary Send channel keystrokes
         * @param {number} id 
         * @param {CreateDelegatedReplyThreadKeystrokesResource} createDelegatedReplyThreadKeystrokesResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendChannelKeystrokes: async (id: number, createDelegatedReplyThreadKeystrokesResource: CreateDelegatedReplyThreadKeystrokesResource, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('sendChannelKeystrokes', 'id', id)
            // verify required parameter 'createDelegatedReplyThreadKeystrokesResource' is not null or undefined
            assertParamExists('sendChannelKeystrokes', 'createDelegatedReplyThreadKeystrokesResource', createDelegatedReplyThreadKeystrokesResource)
            const localVarPath = `/channels/{id}/keystrokes`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(createDelegatedReplyThreadKeystrokesResource, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Sends a message in this channel as the system or on behalf of a user
         * @summary Send a channel message
         * @param {number} id Channel ID
         * @param {CreateMessageResource} createMessageResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendChannelMessage: async (id: number, createMessageResource: CreateMessageResource, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('sendChannelMessage', 'id', id)
            // verify required parameter 'createMessageResource' is not null or undefined
            assertParamExists('sendChannelMessage', 'createMessageResource', createMessageResource)
            const localVarPath = `/channels/{id}/messages`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(createMessageResource, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Updates a channel properties
         * @summary Update a channel
         * @param {number} id Channel ID
         * @param {object} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateChannel: async (id: number, body?: object, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('updateChannel', 'id', id)
            const localVarPath = `/channels/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/json+merge-patch';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * ChannelsApi - functional programming interface
 */
export const ChannelsApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = ChannelsApiAxiosParamCreator(configuration)
    return {
        /**
         * Makes a user a group channel member
         * @summary Add a channel member
         * @param {number} id Channel ID
         * @param {object} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async addChannelMember(id: number, body: object, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChannelResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.addChannelMember(id, body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.addChannelMember']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Makes a user a group channel moderator
         * @summary Add a channel moderator
         * @param {number} id Channel ID
         * @param {object} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async addChannelModerator(id: number, body: object, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatUserResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.addChannelModerator(id, body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.addChannelModerator']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Creates a new channel or returns an equivalent existing channel
         * @summary Create a channel
         * @param {CreateChannelResource} createChannelResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createChannel(createChannelResource: CreateChannelResource, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChannelResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createChannel(createChannelResource, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.createChannel']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Deletes a channel by ID
         * @summary Delete a channel
         * @param {number} id Channel ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteChannel(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApplicationResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteChannel(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.deleteChannel']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of invites sent to join this channel
         * @summary List channel invites
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listChannelInvites(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelChannelInviteResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listChannelInvites(id, page, size, sort, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.listChannelInvites']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of channel members
         * @summary List a channel\'s members
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listChannelMembers(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelChatUserResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listChannelMembers(id, page, size, sort, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.listChannelMembers']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of channel membership info for this channel
         * @summary List channel memberships
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listChannelMemberships(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelChannelMembershipResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listChannelMemberships(id, page, size, sort, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.listChannelMemberships']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of messages sent in this channel
         * @summary List channel messages
         * @param {number} id Channel ID
         * @param {number} [size] The size of the page to be returned
         * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
         * @param {ListChannelMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {string} [username] 
         * @param {string} [query] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listChannelMessages(id: number, size?: number, start?: number, next?: number, relation?: ListChannelMessagesRelationEnum, username?: string, query?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CursorPagedModelMessageResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listChannelMessages(id, size, start, next, relation, username, query, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.listChannelMessages']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of channel moderators
         * @summary Lists a channel\'s moderators
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listChannelModerators(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelChatUserResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listChannelModerators(id, page, size, sort, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.listChannelModerators']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of channel active participants: members that currently online
         * @summary List channel participants
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listChannelParticipants(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelChatUserResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listChannelParticipants(id, page, size, sort, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.listChannelParticipants']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of reported messages in this channel
         * @summary List channel reported messages
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listChannelReportedMessages(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelMessageResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listChannelReportedMessages(id, page, size, sort, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.listChannelReportedMessages']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of channels belonging to this application
         * @summary List channels
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {ListChannelsTypeEnum} [type] Filters by channel type
         * @param {Set<string>} [members] Filters by channel members using their usernames
         * @param {string} [startTime] Filters for channels created within a time range: start time
         * @param {string} [endTime] Filters for channels created within a time range: end time
         * @param {string} [properties] Filters by channel custom properties
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listChannels(page?: number, size?: number, sort?: Array<string>, type?: ListChannelsTypeEnum, members?: Set<string>, startTime?: string, endTime?: string, properties?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelChannelResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listChannels(page, size, sort, type, members, startTime, endTime, properties, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.listChannels']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Removes a member from a group channel
         * @summary Remove a channel member
         * @param {number} id Channel ID
         * @param {number} userId User ID of member to be removed
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async removeChannelMember(id: number, userId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChannelResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.removeChannelMember(id, userId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.removeChannelMember']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Removes a moderator from a group channel
         * @summary Remove a channel moderator
         * @param {number} id Channel ID
         * @param {number} userId User ID of moderator to be removed
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async removeChannelModerator(id: number, userId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChannelResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.removeChannelModerator(id, userId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.removeChannelModerator']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a channel by ID
         * @summary Retrieve a channel
         * @param {number} id Channel ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveChannel(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChannelResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveChannel(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.retrieveChannel']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Sends a custom channel event
         * @summary Send a channel event
         * @param {number} id Channel ID
         * @param {CreateChannelGenericEventResource} createChannelGenericEventResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async sendChannelEvent(id: number, createChannelGenericEventResource: CreateChannelGenericEventResource, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChannelGenericEventResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.sendChannelEvent(id, createChannelGenericEventResource, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.sendChannelEvent']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Sends a channel invite to user
         * @summary Send a channel invite
         * @param {number} id Channel ID
         * @param {CreateChannelInviteResource} createChannelInviteResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async sendChannelInvite(id: number, createChannelInviteResource: CreateChannelInviteResource, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChannelInviteResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.sendChannelInvite(id, createChannelInviteResource, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.sendChannelInvite']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Sends keystrokes in this channel on behalf of a user
         * @summary Send channel keystrokes
         * @param {number} id 
         * @param {CreateDelegatedReplyThreadKeystrokesResource} createDelegatedReplyThreadKeystrokesResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async sendChannelKeystrokes(id: number, createDelegatedReplyThreadKeystrokesResource: CreateDelegatedReplyThreadKeystrokesResource, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ReplyThreadKeystrokesResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.sendChannelKeystrokes(id, createDelegatedReplyThreadKeystrokesResource, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.sendChannelKeystrokes']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Sends a message in this channel as the system or on behalf of a user
         * @summary Send a channel message
         * @param {number} id Channel ID
         * @param {CreateMessageResource} createMessageResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async sendChannelMessage(id: number, createMessageResource: CreateMessageResource, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MessageResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.sendChannelMessage(id, createMessageResource, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.sendChannelMessage']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Updates a channel properties
         * @summary Update a channel
         * @param {number} id Channel ID
         * @param {object} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateChannel(id: number, body?: object, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChannelResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateChannel(id, body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChannelsApi.updateChannel']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * ChannelsApi - factory interface
 */
export const ChannelsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = ChannelsApiFp(configuration)
    return {
        /**
         * Makes a user a group channel member
         * @summary Add a channel member
         * @param {number} id Channel ID
         * @param {object} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        addChannelMember(id: number, body: object, options?: RawAxiosRequestConfig): AxiosPromise<ChannelResource> {
            return localVarFp.addChannelMember(id, body, options).then((request) => request(axios, basePath));
        },
        /**
         * Makes a user a group channel moderator
         * @summary Add a channel moderator
         * @param {number} id Channel ID
         * @param {object} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        addChannelModerator(id: number, body: object, options?: RawAxiosRequestConfig): AxiosPromise<ChatUserResource> {
            return localVarFp.addChannelModerator(id, body, options).then((request) => request(axios, basePath));
        },
        /**
         * Creates a new channel or returns an equivalent existing channel
         * @summary Create a channel
         * @param {CreateChannelResource} createChannelResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createChannel(createChannelResource: CreateChannelResource, options?: RawAxiosRequestConfig): AxiosPromise<ChannelResource> {
            return localVarFp.createChannel(createChannelResource, options).then((request) => request(axios, basePath));
        },
        /**
         * Deletes a channel by ID
         * @summary Delete a channel
         * @param {number} id Channel ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteChannel(id: number, options?: RawAxiosRequestConfig): AxiosPromise<ApplicationResource> {
            return localVarFp.deleteChannel(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of invites sent to join this channel
         * @summary List channel invites
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannelInvites(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelChannelInviteResource> {
            return localVarFp.listChannelInvites(id, page, size, sort, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of channel members
         * @summary List a channel\'s members
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannelMembers(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelChatUserResource> {
            return localVarFp.listChannelMembers(id, page, size, sort, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of channel membership info for this channel
         * @summary List channel memberships
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannelMemberships(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelChannelMembershipResource> {
            return localVarFp.listChannelMemberships(id, page, size, sort, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of messages sent in this channel
         * @summary List channel messages
         * @param {number} id Channel ID
         * @param {number} [size] The size of the page to be returned
         * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
         * @param {ListChannelMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {string} [username] 
         * @param {string} [query] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannelMessages(id: number, size?: number, start?: number, next?: number, relation?: ListChannelMessagesRelationEnum, username?: string, query?: string, options?: RawAxiosRequestConfig): AxiosPromise<CursorPagedModelMessageResource> {
            return localVarFp.listChannelMessages(id, size, start, next, relation, username, query, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of channel moderators
         * @summary Lists a channel\'s moderators
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannelModerators(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelChatUserResource> {
            return localVarFp.listChannelModerators(id, page, size, sort, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of channel active participants: members that currently online
         * @summary List channel participants
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannelParticipants(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelChatUserResource> {
            return localVarFp.listChannelParticipants(id, page, size, sort, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of reported messages in this channel
         * @summary List channel reported messages
         * @param {number} id Channel ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannelReportedMessages(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelMessageResource> {
            return localVarFp.listChannelReportedMessages(id, page, size, sort, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of channels belonging to this application
         * @summary List channels
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {ListChannelsTypeEnum} [type] Filters by channel type
         * @param {Set<string>} [members] Filters by channel members using their usernames
         * @param {string} [startTime] Filters for channels created within a time range: start time
         * @param {string} [endTime] Filters for channels created within a time range: end time
         * @param {string} [properties] Filters by channel custom properties
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChannels(page?: number, size?: number, sort?: Array<string>, type?: ListChannelsTypeEnum, members?: Set<string>, startTime?: string, endTime?: string, properties?: string, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelChannelResource> {
            return localVarFp.listChannels(page, size, sort, type, members, startTime, endTime, properties, options).then((request) => request(axios, basePath));
        },
        /**
         * Removes a member from a group channel
         * @summary Remove a channel member
         * @param {number} id Channel ID
         * @param {number} userId User ID of member to be removed
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        removeChannelMember(id: number, userId: number, options?: RawAxiosRequestConfig): AxiosPromise<ChannelResource> {
            return localVarFp.removeChannelMember(id, userId, options).then((request) => request(axios, basePath));
        },
        /**
         * Removes a moderator from a group channel
         * @summary Remove a channel moderator
         * @param {number} id Channel ID
         * @param {number} userId User ID of moderator to be removed
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        removeChannelModerator(id: number, userId: number, options?: RawAxiosRequestConfig): AxiosPromise<ChannelResource> {
            return localVarFp.removeChannelModerator(id, userId, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a channel by ID
         * @summary Retrieve a channel
         * @param {number} id Channel ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveChannel(id: number, options?: RawAxiosRequestConfig): AxiosPromise<ChannelResource> {
            return localVarFp.retrieveChannel(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Sends a custom channel event
         * @summary Send a channel event
         * @param {number} id Channel ID
         * @param {CreateChannelGenericEventResource} createChannelGenericEventResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendChannelEvent(id: number, createChannelGenericEventResource: CreateChannelGenericEventResource, options?: RawAxiosRequestConfig): AxiosPromise<ChannelGenericEventResource> {
            return localVarFp.sendChannelEvent(id, createChannelGenericEventResource, options).then((request) => request(axios, basePath));
        },
        /**
         * Sends a channel invite to user
         * @summary Send a channel invite
         * @param {number} id Channel ID
         * @param {CreateChannelInviteResource} createChannelInviteResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendChannelInvite(id: number, createChannelInviteResource: CreateChannelInviteResource, options?: RawAxiosRequestConfig): AxiosPromise<ChannelInviteResource> {
            return localVarFp.sendChannelInvite(id, createChannelInviteResource, options).then((request) => request(axios, basePath));
        },
        /**
         * Sends keystrokes in this channel on behalf of a user
         * @summary Send channel keystrokes
         * @param {number} id 
         * @param {CreateDelegatedReplyThreadKeystrokesResource} createDelegatedReplyThreadKeystrokesResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendChannelKeystrokes(id: number, createDelegatedReplyThreadKeystrokesResource: CreateDelegatedReplyThreadKeystrokesResource, options?: RawAxiosRequestConfig): AxiosPromise<ReplyThreadKeystrokesResource> {
            return localVarFp.sendChannelKeystrokes(id, createDelegatedReplyThreadKeystrokesResource, options).then((request) => request(axios, basePath));
        },
        /**
         * Sends a message in this channel as the system or on behalf of a user
         * @summary Send a channel message
         * @param {number} id Channel ID
         * @param {CreateMessageResource} createMessageResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendChannelMessage(id: number, createMessageResource: CreateMessageResource, options?: RawAxiosRequestConfig): AxiosPromise<MessageResource> {
            return localVarFp.sendChannelMessage(id, createMessageResource, options).then((request) => request(axios, basePath));
        },
        /**
         * Updates a channel properties
         * @summary Update a channel
         * @param {number} id Channel ID
         * @param {object} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateChannel(id: number, body?: object, options?: RawAxiosRequestConfig): AxiosPromise<ChannelResource> {
            return localVarFp.updateChannel(id, body, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * ChannelsApi - object-oriented interface
 */
export class ChannelsApi extends BaseAPI {
    /**
     * Makes a user a group channel member
     * @summary Add a channel member
     * @param {number} id Channel ID
     * @param {object} body 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public addChannelMember(id: number, body: object, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).addChannelMember(id, body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Makes a user a group channel moderator
     * @summary Add a channel moderator
     * @param {number} id Channel ID
     * @param {object} body 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public addChannelModerator(id: number, body: object, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).addChannelModerator(id, body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Creates a new channel or returns an equivalent existing channel
     * @summary Create a channel
     * @param {CreateChannelResource} createChannelResource 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public createChannel(createChannelResource: CreateChannelResource, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).createChannel(createChannelResource, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Deletes a channel by ID
     * @summary Delete a channel
     * @param {number} id Channel ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public deleteChannel(id: number, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).deleteChannel(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of invites sent to join this channel
     * @summary List channel invites
     * @param {number} id Channel ID
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listChannelInvites(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).listChannelInvites(id, page, size, sort, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of channel members
     * @summary List a channel\'s members
     * @param {number} id Channel ID
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listChannelMembers(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).listChannelMembers(id, page, size, sort, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of channel membership info for this channel
     * @summary List channel memberships
     * @param {number} id Channel ID
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listChannelMemberships(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).listChannelMemberships(id, page, size, sort, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of messages sent in this channel
     * @summary List channel messages
     * @param {number} id Channel ID
     * @param {number} [size] The size of the page to be returned
     * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
     * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
     * @param {ListChannelMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
     * @param {string} [username] 
     * @param {string} [query] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listChannelMessages(id: number, size?: number, start?: number, next?: number, relation?: ListChannelMessagesRelationEnum, username?: string, query?: string, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).listChannelMessages(id, size, start, next, relation, username, query, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of channel moderators
     * @summary Lists a channel\'s moderators
     * @param {number} id Channel ID
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listChannelModerators(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).listChannelModerators(id, page, size, sort, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of channel active participants: members that currently online
     * @summary List channel participants
     * @param {number} id Channel ID
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listChannelParticipants(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).listChannelParticipants(id, page, size, sort, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of reported messages in this channel
     * @summary List channel reported messages
     * @param {number} id Channel ID
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listChannelReportedMessages(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).listChannelReportedMessages(id, page, size, sort, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of channels belonging to this application
     * @summary List channels
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {ListChannelsTypeEnum} [type] Filters by channel type
     * @param {Set<string>} [members] Filters by channel members using their usernames
     * @param {string} [startTime] Filters for channels created within a time range: start time
     * @param {string} [endTime] Filters for channels created within a time range: end time
     * @param {string} [properties] Filters by channel custom properties
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listChannels(page?: number, size?: number, sort?: Array<string>, type?: ListChannelsTypeEnum, members?: Set<string>, startTime?: string, endTime?: string, properties?: string, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).listChannels(page, size, sort, type, members, startTime, endTime, properties, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Removes a member from a group channel
     * @summary Remove a channel member
     * @param {number} id Channel ID
     * @param {number} userId User ID of member to be removed
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public removeChannelMember(id: number, userId: number, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).removeChannelMember(id, userId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Removes a moderator from a group channel
     * @summary Remove a channel moderator
     * @param {number} id Channel ID
     * @param {number} userId User ID of moderator to be removed
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public removeChannelModerator(id: number, userId: number, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).removeChannelModerator(id, userId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a channel by ID
     * @summary Retrieve a channel
     * @param {number} id Channel ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveChannel(id: number, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).retrieveChannel(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Sends a custom channel event
     * @summary Send a channel event
     * @param {number} id Channel ID
     * @param {CreateChannelGenericEventResource} createChannelGenericEventResource 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public sendChannelEvent(id: number, createChannelGenericEventResource: CreateChannelGenericEventResource, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).sendChannelEvent(id, createChannelGenericEventResource, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Sends a channel invite to user
     * @summary Send a channel invite
     * @param {number} id Channel ID
     * @param {CreateChannelInviteResource} createChannelInviteResource 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public sendChannelInvite(id: number, createChannelInviteResource: CreateChannelInviteResource, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).sendChannelInvite(id, createChannelInviteResource, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Sends keystrokes in this channel on behalf of a user
     * @summary Send channel keystrokes
     * @param {number} id 
     * @param {CreateDelegatedReplyThreadKeystrokesResource} createDelegatedReplyThreadKeystrokesResource 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public sendChannelKeystrokes(id: number, createDelegatedReplyThreadKeystrokesResource: CreateDelegatedReplyThreadKeystrokesResource, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).sendChannelKeystrokes(id, createDelegatedReplyThreadKeystrokesResource, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Sends a message in this channel as the system or on behalf of a user
     * @summary Send a channel message
     * @param {number} id Channel ID
     * @param {CreateMessageResource} createMessageResource 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public sendChannelMessage(id: number, createMessageResource: CreateMessageResource, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).sendChannelMessage(id, createMessageResource, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Updates a channel properties
     * @summary Update a channel
     * @param {number} id Channel ID
     * @param {object} [body] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public updateChannel(id: number, body?: object, options?: RawAxiosRequestConfig) {
        return ChannelsApiFp(this.configuration).updateChannel(id, body, options).then((request) => request(this.axios, this.basePath));
    }
}

export const ListChannelMessagesRelationEnum = {
    Self: 'SELF',
    Previous: 'PREVIOUS',
    Next: 'NEXT'
} as const;
export type ListChannelMessagesRelationEnum = typeof ListChannelMessagesRelationEnum[keyof typeof ListChannelMessagesRelationEnum];
export const ListChannelsTypeEnum = {
    Direct: 'DIRECT',
    Public: 'PUBLIC',
    Private: 'PRIVATE'
} as const;
export type ListChannelsTypeEnum = typeof ListChannelsTypeEnum[keyof typeof ListChannelsTypeEnum];


/**
 * ChatSessionsApi - axios parameter creator
 */
export const ChatSessionsApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Returns a page of chat sessions belonging to this application
         * @summary List chat sessions
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {ListChatSessionsStateEnum} [state] Filters by state
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChatSessions: async (page?: number, size?: number, sort?: Array<string>, state?: ListChatSessionsStateEnum, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/chat-sessions`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }

            if (state !== undefined) {
                localVarQueryParameter['state'] = state;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * ChatSessionsApi - functional programming interface
 */
export const ChatSessionsApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = ChatSessionsApiAxiosParamCreator(configuration)
    return {
        /**
         * Returns a page of chat sessions belonging to this application
         * @summary List chat sessions
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {ListChatSessionsStateEnum} [state] Filters by state
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listChatSessions(page?: number, size?: number, sort?: Array<string>, state?: ListChatSessionsStateEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelChatSessionResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listChatSessions(page, size, sort, state, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ChatSessionsApi.listChatSessions']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * ChatSessionsApi - factory interface
 */
export const ChatSessionsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = ChatSessionsApiFp(configuration)
    return {
        /**
         * Returns a page of chat sessions belonging to this application
         * @summary List chat sessions
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {ListChatSessionsStateEnum} [state] Filters by state
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listChatSessions(page?: number, size?: number, sort?: Array<string>, state?: ListChatSessionsStateEnum, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelChatSessionResource> {
            return localVarFp.listChatSessions(page, size, sort, state, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * ChatSessionsApi - object-oriented interface
 */
export class ChatSessionsApi extends BaseAPI {
    /**
     * Returns a page of chat sessions belonging to this application
     * @summary List chat sessions
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {ListChatSessionsStateEnum} [state] Filters by state
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listChatSessions(page?: number, size?: number, sort?: Array<string>, state?: ListChatSessionsStateEnum, options?: RawAxiosRequestConfig) {
        return ChatSessionsApiFp(this.configuration).listChatSessions(page, size, sort, state, options).then((request) => request(this.axios, this.basePath));
    }
}

export const ListChatSessionsStateEnum = {
    Active: 'ACTIVE',
    Ended: 'ENDED'
} as const;
export type ListChatSessionsStateEnum = typeof ListChatSessionsStateEnum[keyof typeof ListChatSessionsStateEnum];


/**
 * FunctionVersionsApi - axios parameter creator
 */
export const FunctionVersionsApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Returns a chat function version by ID
         * @summary Retrieve a chat function version
         * @param {number} id Chat function version ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveFunctionVersion: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('retrieveFunctionVersion', 'id', id)
            const localVarPath = `/function-versions/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * FunctionVersionsApi - functional programming interface
 */
export const FunctionVersionsApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = FunctionVersionsApiAxiosParamCreator(configuration)
    return {
        /**
         * Returns a chat function version by ID
         * @summary Retrieve a chat function version
         * @param {number} id Chat function version ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveFunctionVersion(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatFunctionVersionResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveFunctionVersion(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['FunctionVersionsApi.retrieveFunctionVersion']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * FunctionVersionsApi - factory interface
 */
export const FunctionVersionsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = FunctionVersionsApiFp(configuration)
    return {
        /**
         * Returns a chat function version by ID
         * @summary Retrieve a chat function version
         * @param {number} id Chat function version ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveFunctionVersion(id: number, options?: RawAxiosRequestConfig): AxiosPromise<ChatFunctionVersionResource> {
            return localVarFp.retrieveFunctionVersion(id, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * FunctionVersionsApi - object-oriented interface
 */
export class FunctionVersionsApi extends BaseAPI {
    /**
     * Returns a chat function version by ID
     * @summary Retrieve a chat function version
     * @param {number} id Chat function version ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveFunctionVersion(id: number, options?: RawAxiosRequestConfig) {
        return FunctionVersionsApiFp(this.configuration).retrieveFunctionVersion(id, options).then((request) => request(this.axios, this.basePath));
    }
}



/**
 * FunctionsApi - axios parameter creator
 */
export const FunctionsApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Creates a new version of this chat function
         * @summary Create a chat function version
         * @param {number} id Chat function ID
         * @param {CreateChatFunctionVersionResource} createChatFunctionVersionResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createFunctionVersion: async (id: number, createChatFunctionVersionResource: CreateChatFunctionVersionResource, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('createFunctionVersion', 'id', id)
            // verify required parameter 'createChatFunctionVersionResource' is not null or undefined
            assertParamExists('createFunctionVersion', 'createChatFunctionVersionResource', createChatFunctionVersionResource)
            const localVarPath = `/functions/{id}/versions`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/vnd.chatkitty+json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(createChatFunctionVersionResource, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of invocations of this chat function. A log of previous runs of the function
         * @summary List chat function invocations
         * @param {number} id Chat function ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listFunctionInvocations: async (id: number, page?: number, size?: number, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listFunctionInvocations', 'id', id)
            const localVarPath = `/functions/{id}/invocations`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of versions of this chat function
         * @summary List chat function versions
         * @param {number} id Chat function ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listFunctionVersions: async (id: number, page?: number, size?: number, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listFunctionVersions', 'id', id)
            const localVarPath = `/functions/{id}/versions`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a chat function by ID
         * @summary Retrieve a chat function
         * @param {number} id Chat function ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveFunction: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('retrieveFunction', 'id', id)
            const localVarPath = `/functions/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns the version of this chat function currently deployed
         * @summary Retrieve chat function current version
         * @param {number} id Chat function ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveFunctionCurrentVersion: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('retrieveFunctionCurrentVersion', 'id', id)
            const localVarPath = `/functions/{id}/current-version`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * FunctionsApi - functional programming interface
 */
export const FunctionsApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = FunctionsApiAxiosParamCreator(configuration)
    return {
        /**
         * Creates a new version of this chat function
         * @summary Create a chat function version
         * @param {number} id Chat function ID
         * @param {CreateChatFunctionVersionResource} createChatFunctionVersionResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createFunctionVersion(id: number, createChatFunctionVersionResource: CreateChatFunctionVersionResource, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatFunctionVersionResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createFunctionVersion(id, createChatFunctionVersionResource, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['FunctionsApi.createFunctionVersion']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of invocations of this chat function. A log of previous runs of the function
         * @summary List chat function invocations
         * @param {number} id Chat function ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listFunctionInvocations(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelChatFunctionInvocationResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listFunctionInvocations(id, page, size, sort, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['FunctionsApi.listFunctionInvocations']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of versions of this chat function
         * @summary List chat function versions
         * @param {number} id Chat function ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listFunctionVersions(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelChatFunctionVersionResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listFunctionVersions(id, page, size, sort, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['FunctionsApi.listFunctionVersions']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a chat function by ID
         * @summary Retrieve a chat function
         * @param {number} id Chat function ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveFunction(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatFunctionResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveFunction(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['FunctionsApi.retrieveFunction']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns the version of this chat function currently deployed
         * @summary Retrieve chat function current version
         * @param {number} id Chat function ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveFunctionCurrentVersion(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatFunctionVersionResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveFunctionCurrentVersion(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['FunctionsApi.retrieveFunctionCurrentVersion']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * FunctionsApi - factory interface
 */
export const FunctionsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = FunctionsApiFp(configuration)
    return {
        /**
         * Creates a new version of this chat function
         * @summary Create a chat function version
         * @param {number} id Chat function ID
         * @param {CreateChatFunctionVersionResource} createChatFunctionVersionResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createFunctionVersion(id: number, createChatFunctionVersionResource: CreateChatFunctionVersionResource, options?: RawAxiosRequestConfig): AxiosPromise<ChatFunctionVersionResource> {
            return localVarFp.createFunctionVersion(id, createChatFunctionVersionResource, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of invocations of this chat function. A log of previous runs of the function
         * @summary List chat function invocations
         * @param {number} id Chat function ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listFunctionInvocations(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelChatFunctionInvocationResource> {
            return localVarFp.listFunctionInvocations(id, page, size, sort, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of versions of this chat function
         * @summary List chat function versions
         * @param {number} id Chat function ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listFunctionVersions(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelChatFunctionVersionResource> {
            return localVarFp.listFunctionVersions(id, page, size, sort, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a chat function by ID
         * @summary Retrieve a chat function
         * @param {number} id Chat function ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveFunction(id: number, options?: RawAxiosRequestConfig): AxiosPromise<ChatFunctionResource> {
            return localVarFp.retrieveFunction(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns the version of this chat function currently deployed
         * @summary Retrieve chat function current version
         * @param {number} id Chat function ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveFunctionCurrentVersion(id: number, options?: RawAxiosRequestConfig): AxiosPromise<ChatFunctionVersionResource> {
            return localVarFp.retrieveFunctionCurrentVersion(id, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * FunctionsApi - object-oriented interface
 */
export class FunctionsApi extends BaseAPI {
    /**
     * Creates a new version of this chat function
     * @summary Create a chat function version
     * @param {number} id Chat function ID
     * @param {CreateChatFunctionVersionResource} createChatFunctionVersionResource 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public createFunctionVersion(id: number, createChatFunctionVersionResource: CreateChatFunctionVersionResource, options?: RawAxiosRequestConfig) {
        return FunctionsApiFp(this.configuration).createFunctionVersion(id, createChatFunctionVersionResource, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of invocations of this chat function. A log of previous runs of the function
     * @summary List chat function invocations
     * @param {number} id Chat function ID
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listFunctionInvocations(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig) {
        return FunctionsApiFp(this.configuration).listFunctionInvocations(id, page, size, sort, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of versions of this chat function
     * @summary List chat function versions
     * @param {number} id Chat function ID
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listFunctionVersions(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig) {
        return FunctionsApiFp(this.configuration).listFunctionVersions(id, page, size, sort, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a chat function by ID
     * @summary Retrieve a chat function
     * @param {number} id Chat function ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveFunction(id: number, options?: RawAxiosRequestConfig) {
        return FunctionsApiFp(this.configuration).retrieveFunction(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns the version of this chat function currently deployed
     * @summary Retrieve chat function current version
     * @param {number} id Chat function ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveFunctionCurrentVersion(id: number, options?: RawAxiosRequestConfig) {
        return FunctionsApiFp(this.configuration).retrieveFunctionCurrentVersion(id, options).then((request) => request(this.axios, this.basePath));
    }
}



/**
 * ImportsApi - axios parameter creator
 */
export const ImportsApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Batch imports channel members from a JSON array file
         * @summary Import channel members
         * @param {number} id 
         * @param {File} file JSON array file with user references to be added as members
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        importChannelMembers: async (id: number, file: File, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('importChannelMembers', 'id', id)
            // verify required parameter 'file' is not null or undefined
            assertParamExists('importChannelMembers', 'file', file)
            const localVarPath = `/imports/channels/{id}/members`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;
            const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


            if (file !== undefined) { 
                localVarFormParams.append('file', file as any);
            }
    
    
            localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = localVarFormParams;

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Batch imports channels from a JSON array file
         * @summary Import channels
         * @param {File} file JSON array file with channels
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        importChannels: async (file: File, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'file' is not null or undefined
            assertParamExists('importChannels', 'file', file)
            const localVarPath = `/imports/channels`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;
            const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


            if (file !== undefined) { 
                localVarFormParams.append('file', file as any);
            }
    
    
            localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = localVarFormParams;

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Batch imports messages from a JSON array file
         * @summary Import messages
         * @param {File} file JSON array file with messages
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        importMessages: async (file: File, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'file' is not null or undefined
            assertParamExists('importMessages', 'file', file)
            const localVarPath = `/imports/messages`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;
            const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


            if (file !== undefined) { 
                localVarFormParams.append('file', file as any);
            }
    
    
            localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = localVarFormParams;

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Batch imports users from a JSON array file
         * @summary Import users
         * @param {File} file JSON array file with users
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        importUsers: async (file: File, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'file' is not null or undefined
            assertParamExists('importUsers', 'file', file)
            const localVarPath = `/imports/users`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;
            const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


            if (file !== undefined) { 
                localVarFormParams.append('file', file as any);
            }
    
    
            localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = localVarFormParams;

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * ImportsApi - functional programming interface
 */
export const ImportsApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = ImportsApiAxiosParamCreator(configuration)
    return {
        /**
         * Batch imports channel members from a JSON array file
         * @summary Import channel members
         * @param {number} id 
         * @param {File} file JSON array file with user references to be added as members
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async importChannelMembers(id: number, file: File, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApplicationJobResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.importChannelMembers(id, file, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ImportsApi.importChannelMembers']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Batch imports channels from a JSON array file
         * @summary Import channels
         * @param {File} file JSON array file with channels
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async importChannels(file: File, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApplicationJobResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.importChannels(file, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ImportsApi.importChannels']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Batch imports messages from a JSON array file
         * @summary Import messages
         * @param {File} file JSON array file with messages
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async importMessages(file: File, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApplicationJobResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.importMessages(file, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ImportsApi.importMessages']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Batch imports users from a JSON array file
         * @summary Import users
         * @param {File} file JSON array file with users
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async importUsers(file: File, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApplicationJobResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.importUsers(file, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ImportsApi.importUsers']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * ImportsApi - factory interface
 */
export const ImportsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = ImportsApiFp(configuration)
    return {
        /**
         * Batch imports channel members from a JSON array file
         * @summary Import channel members
         * @param {number} id 
         * @param {File} file JSON array file with user references to be added as members
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        importChannelMembers(id: number, file: File, options?: RawAxiosRequestConfig): AxiosPromise<ApplicationJobResource> {
            return localVarFp.importChannelMembers(id, file, options).then((request) => request(axios, basePath));
        },
        /**
         * Batch imports channels from a JSON array file
         * @summary Import channels
         * @param {File} file JSON array file with channels
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        importChannels(file: File, options?: RawAxiosRequestConfig): AxiosPromise<ApplicationJobResource> {
            return localVarFp.importChannels(file, options).then((request) => request(axios, basePath));
        },
        /**
         * Batch imports messages from a JSON array file
         * @summary Import messages
         * @param {File} file JSON array file with messages
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        importMessages(file: File, options?: RawAxiosRequestConfig): AxiosPromise<ApplicationJobResource> {
            return localVarFp.importMessages(file, options).then((request) => request(axios, basePath));
        },
        /**
         * Batch imports users from a JSON array file
         * @summary Import users
         * @param {File} file JSON array file with users
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        importUsers(file: File, options?: RawAxiosRequestConfig): AxiosPromise<ApplicationJobResource> {
            return localVarFp.importUsers(file, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * ImportsApi - object-oriented interface
 */
export class ImportsApi extends BaseAPI {
    /**
     * Batch imports channel members from a JSON array file
     * @summary Import channel members
     * @param {number} id 
     * @param {File} file JSON array file with user references to be added as members
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public importChannelMembers(id: number, file: File, options?: RawAxiosRequestConfig) {
        return ImportsApiFp(this.configuration).importChannelMembers(id, file, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Batch imports channels from a JSON array file
     * @summary Import channels
     * @param {File} file JSON array file with channels
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public importChannels(file: File, options?: RawAxiosRequestConfig) {
        return ImportsApiFp(this.configuration).importChannels(file, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Batch imports messages from a JSON array file
     * @summary Import messages
     * @param {File} file JSON array file with messages
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public importMessages(file: File, options?: RawAxiosRequestConfig) {
        return ImportsApiFp(this.configuration).importMessages(file, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Batch imports users from a JSON array file
     * @summary Import users
     * @param {File} file JSON array file with users
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public importUsers(file: File, options?: RawAxiosRequestConfig) {
        return ImportsApiFp(this.configuration).importUsers(file, options).then((request) => request(this.axios, this.basePath));
    }
}



/**
 * JobsApi - axios parameter creator
 */
export const JobsApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Returns a page of jobs created for this application
         * @summary List jobs
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {boolean} [running] Filters for jobs currently running
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listJobs: async (page?: number, size?: number, sort?: Array<string>, running?: boolean, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/jobs`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }

            if (running !== undefined) {
                localVarQueryParameter['running'] = running;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a job by ID
         * @summary Retrieve a job
         * @param {number} id Job ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveJob: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('retrieveJob', 'id', id)
            const localVarPath = `/jobs/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * JobsApi - functional programming interface
 */
export const JobsApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = JobsApiAxiosParamCreator(configuration)
    return {
        /**
         * Returns a page of jobs created for this application
         * @summary List jobs
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {boolean} [running] Filters for jobs currently running
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listJobs(page?: number, size?: number, sort?: Array<string>, running?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelApplicationJobResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listJobs(page, size, sort, running, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['JobsApi.listJobs']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a job by ID
         * @summary Retrieve a job
         * @param {number} id Job ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveJob(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApplicationJobResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveJob(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['JobsApi.retrieveJob']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * JobsApi - factory interface
 */
export const JobsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = JobsApiFp(configuration)
    return {
        /**
         * Returns a page of jobs created for this application
         * @summary List jobs
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {boolean} [running] Filters for jobs currently running
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listJobs(page?: number, size?: number, sort?: Array<string>, running?: boolean, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelApplicationJobResource> {
            return localVarFp.listJobs(page, size, sort, running, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a job by ID
         * @summary Retrieve a job
         * @param {number} id Job ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveJob(id: number, options?: RawAxiosRequestConfig): AxiosPromise<ApplicationJobResource> {
            return localVarFp.retrieveJob(id, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * JobsApi - object-oriented interface
 */
export class JobsApi extends BaseAPI {
    /**
     * Returns a page of jobs created for this application
     * @summary List jobs
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {boolean} [running] Filters for jobs currently running
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listJobs(page?: number, size?: number, sort?: Array<string>, running?: boolean, options?: RawAxiosRequestConfig) {
        return JobsApiFp(this.configuration).listJobs(page, size, sort, running, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a job by ID
     * @summary Retrieve a job
     * @param {number} id Job ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveJob(id: number, options?: RawAxiosRequestConfig) {
        return JobsApiFp(this.configuration).retrieveJob(id, options).then((request) => request(this.axios, this.basePath));
    }
}



/**
 * MessagesApi - axios parameter creator
 */
export const MessagesApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Deletes a message by ID
         * @summary Delete a message
         * @param {number} id Message ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteMessage: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('deleteMessage', 'id', id)
            const localVarPath = `/messages/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Deletes all messages belonging to this application
         * @summary Delete messages
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteMessages: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/messages`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of read receipts for this message
         * @summary List message read receipts
         * @param {number} id 
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listMessageReadReceipts: async (id: number, page?: number, size?: number, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listMessageReadReceipts', 'id', id)
            const localVarPath = `/messages/{id}/read-receipts`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of messages belonging to this application
         * @summary List messages
         * @param {number} [size] The size of the page to be returned
         * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
         * @param {ListMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {string} [username] Filters messages by a sender\&#39;s username
         * @param {string} [query] Filters text messages by text contained in the message body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listMessages: async (size?: number, start?: number, next?: number, relation?: ListMessagesRelationEnum, username?: string, query?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/messages`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (start !== undefined) {
                localVarQueryParameter['start'] = start;
            }

            if (next !== undefined) {
                localVarQueryParameter['next'] = next;
            }

            if (relation !== undefined) {
                localVarQueryParameter['relation'] = relation;
            }

            if (username !== undefined) {
                localVarQueryParameter['username'] = username;
            }

            if (query !== undefined) {
                localVarQueryParameter['query'] = query;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a message by ID
         * @summary Retrieve a message
         * @param {number} id Message ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveMessage: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('retrieveMessage', 'id', id)
            const localVarPath = `/messages/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Updates a message properties
         * @summary Update a message
         * @param {number} id Message ID
         * @param {object} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateMessage: async (id: number, body?: object, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('updateMessage', 'id', id)
            const localVarPath = `/messages/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/json+merge-patch';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * MessagesApi - functional programming interface
 */
export const MessagesApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = MessagesApiAxiosParamCreator(configuration)
    return {
        /**
         * Deletes a message by ID
         * @summary Delete a message
         * @param {number} id Message ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteMessage(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ReplyThreadResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteMessage(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['MessagesApi.deleteMessage']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Deletes all messages belonging to this application
         * @summary Delete messages
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteMessages(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApplicationResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteMessages(options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['MessagesApi.deleteMessages']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of read receipts for this message
         * @summary List message read receipts
         * @param {number} id 
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listMessageReadReceipts(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelMessageReadReceiptResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listMessageReadReceipts(id, page, size, sort, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['MessagesApi.listMessageReadReceipts']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of messages belonging to this application
         * @summary List messages
         * @param {number} [size] The size of the page to be returned
         * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
         * @param {ListMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {string} [username] Filters messages by a sender\&#39;s username
         * @param {string} [query] Filters text messages by text contained in the message body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listMessages(size?: number, start?: number, next?: number, relation?: ListMessagesRelationEnum, username?: string, query?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CursorPagedModelMessageResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listMessages(size, start, next, relation, username, query, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['MessagesApi.listMessages']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a message by ID
         * @summary Retrieve a message
         * @param {number} id Message ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveMessage(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MessageResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveMessage(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['MessagesApi.retrieveMessage']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Updates a message properties
         * @summary Update a message
         * @param {number} id Message ID
         * @param {object} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateMessage(id: number, body?: object, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MessageResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateMessage(id, body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['MessagesApi.updateMessage']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * MessagesApi - factory interface
 */
export const MessagesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = MessagesApiFp(configuration)
    return {
        /**
         * Deletes a message by ID
         * @summary Delete a message
         * @param {number} id Message ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteMessage(id: number, options?: RawAxiosRequestConfig): AxiosPromise<ReplyThreadResource> {
            return localVarFp.deleteMessage(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Deletes all messages belonging to this application
         * @summary Delete messages
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteMessages(options?: RawAxiosRequestConfig): AxiosPromise<ApplicationResource> {
            return localVarFp.deleteMessages(options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of read receipts for this message
         * @summary List message read receipts
         * @param {number} id 
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listMessageReadReceipts(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelMessageReadReceiptResource> {
            return localVarFp.listMessageReadReceipts(id, page, size, sort, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of messages belonging to this application
         * @summary List messages
         * @param {number} [size] The size of the page to be returned
         * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
         * @param {ListMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {string} [username] Filters messages by a sender\&#39;s username
         * @param {string} [query] Filters text messages by text contained in the message body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listMessages(size?: number, start?: number, next?: number, relation?: ListMessagesRelationEnum, username?: string, query?: string, options?: RawAxiosRequestConfig): AxiosPromise<CursorPagedModelMessageResource> {
            return localVarFp.listMessages(size, start, next, relation, username, query, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a message by ID
         * @summary Retrieve a message
         * @param {number} id Message ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveMessage(id: number, options?: RawAxiosRequestConfig): AxiosPromise<MessageResource> {
            return localVarFp.retrieveMessage(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Updates a message properties
         * @summary Update a message
         * @param {number} id Message ID
         * @param {object} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateMessage(id: number, body?: object, options?: RawAxiosRequestConfig): AxiosPromise<MessageResource> {
            return localVarFp.updateMessage(id, body, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * MessagesApi - object-oriented interface
 */
export class MessagesApi extends BaseAPI {
    /**
     * Deletes a message by ID
     * @summary Delete a message
     * @param {number} id Message ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public deleteMessage(id: number, options?: RawAxiosRequestConfig) {
        return MessagesApiFp(this.configuration).deleteMessage(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Deletes all messages belonging to this application
     * @summary Delete messages
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public deleteMessages(options?: RawAxiosRequestConfig) {
        return MessagesApiFp(this.configuration).deleteMessages(options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of read receipts for this message
     * @summary List message read receipts
     * @param {number} id 
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listMessageReadReceipts(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig) {
        return MessagesApiFp(this.configuration).listMessageReadReceipts(id, page, size, sort, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of messages belonging to this application
     * @summary List messages
     * @param {number} [size] The size of the page to be returned
     * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
     * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
     * @param {ListMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
     * @param {string} [username] Filters messages by a sender\&#39;s username
     * @param {string} [query] Filters text messages by text contained in the message body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listMessages(size?: number, start?: number, next?: number, relation?: ListMessagesRelationEnum, username?: string, query?: string, options?: RawAxiosRequestConfig) {
        return MessagesApiFp(this.configuration).listMessages(size, start, next, relation, username, query, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a message by ID
     * @summary Retrieve a message
     * @param {number} id Message ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveMessage(id: number, options?: RawAxiosRequestConfig) {
        return MessagesApiFp(this.configuration).retrieveMessage(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Updates a message properties
     * @summary Update a message
     * @param {number} id Message ID
     * @param {object} [body] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public updateMessage(id: number, body?: object, options?: RawAxiosRequestConfig) {
        return MessagesApiFp(this.configuration).updateMessage(id, body, options).then((request) => request(this.axios, this.basePath));
    }
}

export const ListMessagesRelationEnum = {
    Self: 'SELF',
    Previous: 'PREVIOUS',
    Next: 'NEXT'
} as const;
export type ListMessagesRelationEnum = typeof ListMessagesRelationEnum[keyof typeof ListMessagesRelationEnum];


/**
 * RuntimeApi - axios parameter creator
 */
export const RuntimeApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Creates a NodeJS chat function for this runtime
         * @summary Create a NodeJS chat runtime function
         * @param {CreateChatFunctionResource} createChatFunctionResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createNodejsRuntimeFunction: async (createChatFunctionResource: CreateChatFunctionResource, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'createChatFunctionResource' is not null or undefined
            assertParamExists('createNodejsRuntimeFunction', 'createChatFunctionResource', createChatFunctionResource)
            const localVarPath = `/runtimes/nodejs/functions`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/vnd.chatkitty+json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(createChatFunctionResource, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of functions for this application\'s NodeJS chat runtime
         * @summary List NodeJS chat runtime functions
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listNodejsRuntimeFunctions: async (page?: number, size?: number, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/runtimes/nodejs/functions`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Return this application\'s NodeJS chat runtime
         * @summary Retrieve NodeJS chat runtime
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveNodejsRuntime: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/runtimes/nodejs`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Updates the NPM dependencies for this application\'s NodeJS chat runtime
         * @summary Update NodeJS chat runtime NPM dependencies
         * @param {Array<ChatRuntimeDependencyProperties>} chatRuntimeDependencyProperties 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateNodejsRuntimeDependencies: async (chatRuntimeDependencyProperties: Array<ChatRuntimeDependencyProperties>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'chatRuntimeDependencyProperties' is not null or undefined
            assertParamExists('updateNodejsRuntimeDependencies', 'chatRuntimeDependencyProperties', chatRuntimeDependencyProperties)
            const localVarPath = `/runtimes/nodejs/dependencies`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/vnd.chatkitty+json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(chatRuntimeDependencyProperties, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Updates the runtime environment variables of this application\'s NodeJS chat runtime
         * @summary Update NodeJS chat runtime environment variables
         * @param {{ [key: string]: string; }} requestBody 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateNodejsRuntimeEnvironmentVariables: async (requestBody: { [key: string]: string; }, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'requestBody' is not null or undefined
            assertParamExists('updateNodejsRuntimeEnvironmentVariables', 'requestBody', requestBody)
            const localVarPath = `/runtimes/nodejs/environment-variables`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/vnd.chatkitty+json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(requestBody, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Updates the initialization script for this application\'s NodeJS chat runtime
         * @summary Update NodeJS chat runtime initialization script
         * @param {ChatRuntimeScriptProperties} chatRuntimeScriptProperties 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateNodejsRuntimeInitializationScript: async (chatRuntimeScriptProperties: ChatRuntimeScriptProperties, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'chatRuntimeScriptProperties' is not null or undefined
            assertParamExists('updateNodejsRuntimeInitializationScript', 'chatRuntimeScriptProperties', chatRuntimeScriptProperties)
            const localVarPath = `/runtimes/nodejs/initialization-script`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/vnd.chatkitty+json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(chatRuntimeScriptProperties, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * RuntimeApi - functional programming interface
 */
export const RuntimeApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = RuntimeApiAxiosParamCreator(configuration)
    return {
        /**
         * Creates a NodeJS chat function for this runtime
         * @summary Create a NodeJS chat runtime function
         * @param {CreateChatFunctionResource} createChatFunctionResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createNodejsRuntimeFunction(createChatFunctionResource: CreateChatFunctionResource, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatFunctionResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createNodejsRuntimeFunction(createChatFunctionResource, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RuntimeApi.createNodejsRuntimeFunction']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of functions for this application\'s NodeJS chat runtime
         * @summary List NodeJS chat runtime functions
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listNodejsRuntimeFunctions(page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelChatFunctionResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listNodejsRuntimeFunctions(page, size, sort, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RuntimeApi.listNodejsRuntimeFunctions']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Return this application\'s NodeJS chat runtime
         * @summary Retrieve NodeJS chat runtime
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveNodejsRuntime(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatRuntimeResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveNodejsRuntime(options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RuntimeApi.retrieveNodejsRuntime']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Updates the NPM dependencies for this application\'s NodeJS chat runtime
         * @summary Update NodeJS chat runtime NPM dependencies
         * @param {Array<ChatRuntimeDependencyProperties>} chatRuntimeDependencyProperties 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateNodejsRuntimeDependencies(chatRuntimeDependencyProperties: Array<ChatRuntimeDependencyProperties>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatRuntimeResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateNodejsRuntimeDependencies(chatRuntimeDependencyProperties, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RuntimeApi.updateNodejsRuntimeDependencies']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Updates the runtime environment variables of this application\'s NodeJS chat runtime
         * @summary Update NodeJS chat runtime environment variables
         * @param {{ [key: string]: string; }} requestBody 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateNodejsRuntimeEnvironmentVariables(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatRuntimeResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateNodejsRuntimeEnvironmentVariables(requestBody, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RuntimeApi.updateNodejsRuntimeEnvironmentVariables']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Updates the initialization script for this application\'s NodeJS chat runtime
         * @summary Update NodeJS chat runtime initialization script
         * @param {ChatRuntimeScriptProperties} chatRuntimeScriptProperties 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateNodejsRuntimeInitializationScript(chatRuntimeScriptProperties: ChatRuntimeScriptProperties, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatRuntimeResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateNodejsRuntimeInitializationScript(chatRuntimeScriptProperties, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RuntimeApi.updateNodejsRuntimeInitializationScript']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * RuntimeApi - factory interface
 */
export const RuntimeApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = RuntimeApiFp(configuration)
    return {
        /**
         * Creates a NodeJS chat function for this runtime
         * @summary Create a NodeJS chat runtime function
         * @param {CreateChatFunctionResource} createChatFunctionResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createNodejsRuntimeFunction(createChatFunctionResource: CreateChatFunctionResource, options?: RawAxiosRequestConfig): AxiosPromise<ChatFunctionResource> {
            return localVarFp.createNodejsRuntimeFunction(createChatFunctionResource, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of functions for this application\'s NodeJS chat runtime
         * @summary List NodeJS chat runtime functions
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listNodejsRuntimeFunctions(page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelChatFunctionResource> {
            return localVarFp.listNodejsRuntimeFunctions(page, size, sort, options).then((request) => request(axios, basePath));
        },
        /**
         * Return this application\'s NodeJS chat runtime
         * @summary Retrieve NodeJS chat runtime
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveNodejsRuntime(options?: RawAxiosRequestConfig): AxiosPromise<ChatRuntimeResource> {
            return localVarFp.retrieveNodejsRuntime(options).then((request) => request(axios, basePath));
        },
        /**
         * Updates the NPM dependencies for this application\'s NodeJS chat runtime
         * @summary Update NodeJS chat runtime NPM dependencies
         * @param {Array<ChatRuntimeDependencyProperties>} chatRuntimeDependencyProperties 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateNodejsRuntimeDependencies(chatRuntimeDependencyProperties: Array<ChatRuntimeDependencyProperties>, options?: RawAxiosRequestConfig): AxiosPromise<ChatRuntimeResource> {
            return localVarFp.updateNodejsRuntimeDependencies(chatRuntimeDependencyProperties, options).then((request) => request(axios, basePath));
        },
        /**
         * Updates the runtime environment variables of this application\'s NodeJS chat runtime
         * @summary Update NodeJS chat runtime environment variables
         * @param {{ [key: string]: string; }} requestBody 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateNodejsRuntimeEnvironmentVariables(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): AxiosPromise<ChatRuntimeResource> {
            return localVarFp.updateNodejsRuntimeEnvironmentVariables(requestBody, options).then((request) => request(axios, basePath));
        },
        /**
         * Updates the initialization script for this application\'s NodeJS chat runtime
         * @summary Update NodeJS chat runtime initialization script
         * @param {ChatRuntimeScriptProperties} chatRuntimeScriptProperties 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateNodejsRuntimeInitializationScript(chatRuntimeScriptProperties: ChatRuntimeScriptProperties, options?: RawAxiosRequestConfig): AxiosPromise<ChatRuntimeResource> {
            return localVarFp.updateNodejsRuntimeInitializationScript(chatRuntimeScriptProperties, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * RuntimeApi - object-oriented interface
 */
export class RuntimeApi extends BaseAPI {
    /**
     * Creates a NodeJS chat function for this runtime
     * @summary Create a NodeJS chat runtime function
     * @param {CreateChatFunctionResource} createChatFunctionResource 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public createNodejsRuntimeFunction(createChatFunctionResource: CreateChatFunctionResource, options?: RawAxiosRequestConfig) {
        return RuntimeApiFp(this.configuration).createNodejsRuntimeFunction(createChatFunctionResource, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of functions for this application\'s NodeJS chat runtime
     * @summary List NodeJS chat runtime functions
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listNodejsRuntimeFunctions(page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig) {
        return RuntimeApiFp(this.configuration).listNodejsRuntimeFunctions(page, size, sort, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Return this application\'s NodeJS chat runtime
     * @summary Retrieve NodeJS chat runtime
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveNodejsRuntime(options?: RawAxiosRequestConfig) {
        return RuntimeApiFp(this.configuration).retrieveNodejsRuntime(options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Updates the NPM dependencies for this application\'s NodeJS chat runtime
     * @summary Update NodeJS chat runtime NPM dependencies
     * @param {Array<ChatRuntimeDependencyProperties>} chatRuntimeDependencyProperties 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public updateNodejsRuntimeDependencies(chatRuntimeDependencyProperties: Array<ChatRuntimeDependencyProperties>, options?: RawAxiosRequestConfig) {
        return RuntimeApiFp(this.configuration).updateNodejsRuntimeDependencies(chatRuntimeDependencyProperties, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Updates the runtime environment variables of this application\'s NodeJS chat runtime
     * @summary Update NodeJS chat runtime environment variables
     * @param {{ [key: string]: string; }} requestBody 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public updateNodejsRuntimeEnvironmentVariables(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig) {
        return RuntimeApiFp(this.configuration).updateNodejsRuntimeEnvironmentVariables(requestBody, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Updates the initialization script for this application\'s NodeJS chat runtime
     * @summary Update NodeJS chat runtime initialization script
     * @param {ChatRuntimeScriptProperties} chatRuntimeScriptProperties 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public updateNodejsRuntimeInitializationScript(chatRuntimeScriptProperties: ChatRuntimeScriptProperties, options?: RawAxiosRequestConfig) {
        return RuntimeApiFp(this.configuration).updateNodejsRuntimeInitializationScript(chatRuntimeScriptProperties, options).then((request) => request(this.axios, this.basePath));
    }
}



/**
 * ThreadsApi - axios parameter creator
 */
export const ThreadsApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Returns a page of replies sent in this thread
         * @summary List reply thread messages
         * @param {number} id 
         * @param {number} [size] The size of the page to be returned
         * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
         * @param {ListThreadMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listThreadMessages: async (id: number, size?: number, start?: number, next?: number, relation?: ListThreadMessagesRelationEnum, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listThreadMessages', 'id', id)
            const localVarPath = `/threads/{id}/messages`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (start !== undefined) {
                localVarQueryParameter['start'] = start;
            }

            if (next !== undefined) {
                localVarQueryParameter['next'] = next;
            }

            if (relation !== undefined) {
                localVarQueryParameter['relation'] = relation;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a thread by ID
         * @summary Retrieve a thread
         * @param {number} id Reply thread ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveThread: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('retrieveThread', 'id', id)
            const localVarPath = `/threads/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Sends keystrokes in this thread on behalf of a user
         * @summary Send thread keystrokes
         * @param {number} id 
         * @param {CreateDelegatedReplyThreadKeystrokesResource} createDelegatedReplyThreadKeystrokesResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendThreadKeystrokes: async (id: number, createDelegatedReplyThreadKeystrokesResource: CreateDelegatedReplyThreadKeystrokesResource, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('sendThreadKeystrokes', 'id', id)
            // verify required parameter 'createDelegatedReplyThreadKeystrokesResource' is not null or undefined
            assertParamExists('sendThreadKeystrokes', 'createDelegatedReplyThreadKeystrokesResource', createDelegatedReplyThreadKeystrokesResource)
            const localVarPath = `/threads/{id}/keystrokes`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(createDelegatedReplyThreadKeystrokesResource, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Sends a reply message in this thread as the system or on behalf of a user
         * @summary Send a reply thread message
         * @param {number} id 
         * @param {CreateMessageResource} createMessageResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendThreadMessage: async (id: number, createMessageResource: CreateMessageResource, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('sendThreadMessage', 'id', id)
            // verify required parameter 'createMessageResource' is not null or undefined
            assertParamExists('sendThreadMessage', 'createMessageResource', createMessageResource)
            const localVarPath = `/threads/{id}/messages`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(createMessageResource, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * ThreadsApi - functional programming interface
 */
export const ThreadsApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = ThreadsApiAxiosParamCreator(configuration)
    return {
        /**
         * Returns a page of replies sent in this thread
         * @summary List reply thread messages
         * @param {number} id 
         * @param {number} [size] The size of the page to be returned
         * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
         * @param {ListThreadMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listThreadMessages(id: number, size?: number, start?: number, next?: number, relation?: ListThreadMessagesRelationEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CursorPagedModelMessageResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listThreadMessages(id, size, start, next, relation, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ThreadsApi.listThreadMessages']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a thread by ID
         * @summary Retrieve a thread
         * @param {number} id Reply thread ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveThread(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ReplyThreadResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveThread(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ThreadsApi.retrieveThread']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Sends keystrokes in this thread on behalf of a user
         * @summary Send thread keystrokes
         * @param {number} id 
         * @param {CreateDelegatedReplyThreadKeystrokesResource} createDelegatedReplyThreadKeystrokesResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async sendThreadKeystrokes(id: number, createDelegatedReplyThreadKeystrokesResource: CreateDelegatedReplyThreadKeystrokesResource, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ReplyThreadKeystrokesResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.sendThreadKeystrokes(id, createDelegatedReplyThreadKeystrokesResource, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ThreadsApi.sendThreadKeystrokes']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Sends a reply message in this thread as the system or on behalf of a user
         * @summary Send a reply thread message
         * @param {number} id 
         * @param {CreateMessageResource} createMessageResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async sendThreadMessage(id: number, createMessageResource: CreateMessageResource, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MessageResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.sendThreadMessage(id, createMessageResource, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ThreadsApi.sendThreadMessage']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * ThreadsApi - factory interface
 */
export const ThreadsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = ThreadsApiFp(configuration)
    return {
        /**
         * Returns a page of replies sent in this thread
         * @summary List reply thread messages
         * @param {number} id 
         * @param {number} [size] The size of the page to be returned
         * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
         * @param {ListThreadMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listThreadMessages(id: number, size?: number, start?: number, next?: number, relation?: ListThreadMessagesRelationEnum, options?: RawAxiosRequestConfig): AxiosPromise<CursorPagedModelMessageResource> {
            return localVarFp.listThreadMessages(id, size, start, next, relation, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a thread by ID
         * @summary Retrieve a thread
         * @param {number} id Reply thread ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveThread(id: number, options?: RawAxiosRequestConfig): AxiosPromise<ReplyThreadResource> {
            return localVarFp.retrieveThread(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Sends keystrokes in this thread on behalf of a user
         * @summary Send thread keystrokes
         * @param {number} id 
         * @param {CreateDelegatedReplyThreadKeystrokesResource} createDelegatedReplyThreadKeystrokesResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendThreadKeystrokes(id: number, createDelegatedReplyThreadKeystrokesResource: CreateDelegatedReplyThreadKeystrokesResource, options?: RawAxiosRequestConfig): AxiosPromise<ReplyThreadKeystrokesResource> {
            return localVarFp.sendThreadKeystrokes(id, createDelegatedReplyThreadKeystrokesResource, options).then((request) => request(axios, basePath));
        },
        /**
         * Sends a reply message in this thread as the system or on behalf of a user
         * @summary Send a reply thread message
         * @param {number} id 
         * @param {CreateMessageResource} createMessageResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        sendThreadMessage(id: number, createMessageResource: CreateMessageResource, options?: RawAxiosRequestConfig): AxiosPromise<MessageResource> {
            return localVarFp.sendThreadMessage(id, createMessageResource, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * ThreadsApi - object-oriented interface
 */
export class ThreadsApi extends BaseAPI {
    /**
     * Returns a page of replies sent in this thread
     * @summary List reply thread messages
     * @param {number} id 
     * @param {number} [size] The size of the page to be returned
     * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
     * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
     * @param {ListThreadMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listThreadMessages(id: number, size?: number, start?: number, next?: number, relation?: ListThreadMessagesRelationEnum, options?: RawAxiosRequestConfig) {
        return ThreadsApiFp(this.configuration).listThreadMessages(id, size, start, next, relation, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a thread by ID
     * @summary Retrieve a thread
     * @param {number} id Reply thread ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveThread(id: number, options?: RawAxiosRequestConfig) {
        return ThreadsApiFp(this.configuration).retrieveThread(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Sends keystrokes in this thread on behalf of a user
     * @summary Send thread keystrokes
     * @param {number} id 
     * @param {CreateDelegatedReplyThreadKeystrokesResource} createDelegatedReplyThreadKeystrokesResource 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public sendThreadKeystrokes(id: number, createDelegatedReplyThreadKeystrokesResource: CreateDelegatedReplyThreadKeystrokesResource, options?: RawAxiosRequestConfig) {
        return ThreadsApiFp(this.configuration).sendThreadKeystrokes(id, createDelegatedReplyThreadKeystrokesResource, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Sends a reply message in this thread as the system or on behalf of a user
     * @summary Send a reply thread message
     * @param {number} id 
     * @param {CreateMessageResource} createMessageResource 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public sendThreadMessage(id: number, createMessageResource: CreateMessageResource, options?: RawAxiosRequestConfig) {
        return ThreadsApiFp(this.configuration).sendThreadMessage(id, createMessageResource, options).then((request) => request(this.axios, this.basePath));
    }
}

export const ListThreadMessagesRelationEnum = {
    Self: 'SELF',
    Previous: 'PREVIOUS',
    Next: 'NEXT'
} as const;
export type ListThreadMessagesRelationEnum = typeof ListThreadMessagesRelationEnum[keyof typeof ListThreadMessagesRelationEnum];


/**
 * UserSessionsApi - axios parameter creator
 */
export const UserSessionsApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Returns a page of user sessions belonging to this application
         * @summary List user sessions
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {ListUserSessionsStateEnum} [state] Filters by state
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listUserSessions: async (page?: number, size?: number, sort?: Array<string>, state?: ListUserSessionsStateEnum, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/user-sessions`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }

            if (state !== undefined) {
                localVarQueryParameter['state'] = state;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * UserSessionsApi - functional programming interface
 */
export const UserSessionsApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = UserSessionsApiAxiosParamCreator(configuration)
    return {
        /**
         * Returns a page of user sessions belonging to this application
         * @summary List user sessions
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {ListUserSessionsStateEnum} [state] Filters by state
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listUserSessions(page?: number, size?: number, sort?: Array<string>, state?: ListUserSessionsStateEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelChatUserSessionResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listUserSessions(page, size, sort, state, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UserSessionsApi.listUserSessions']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * UserSessionsApi - factory interface
 */
export const UserSessionsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = UserSessionsApiFp(configuration)
    return {
        /**
         * Returns a page of user sessions belonging to this application
         * @summary List user sessions
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {ListUserSessionsStateEnum} [state] Filters by state
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listUserSessions(page?: number, size?: number, sort?: Array<string>, state?: ListUserSessionsStateEnum, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelChatUserSessionResource> {
            return localVarFp.listUserSessions(page, size, sort, state, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * UserSessionsApi - object-oriented interface
 */
export class UserSessionsApi extends BaseAPI {
    /**
     * Returns a page of user sessions belonging to this application
     * @summary List user sessions
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {ListUserSessionsStateEnum} [state] Filters by state
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listUserSessions(page?: number, size?: number, sort?: Array<string>, state?: ListUserSessionsStateEnum, options?: RawAxiosRequestConfig) {
        return UserSessionsApiFp(this.configuration).listUserSessions(page, size, sort, state, options).then((request) => request(this.axios, this.basePath));
    }
}

export const ListUserSessionsStateEnum = {
    Active: 'ACTIVE',
    Ended: 'ENDED'
} as const;
export type ListUserSessionsStateEnum = typeof ListUserSessionsStateEnum[keyof typeof ListUserSessionsStateEnum];


/**
 * UsersApi - axios parameter creator
 */
export const UsersApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Checks if a user exists
         * @summary Check a user exists
         * @param {string} name Username of the user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        checkUserExists: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'name' is not null or undefined
            assertParamExists('checkUserExists', 'name', name)
            const localVarPath = `/users`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'HEAD', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (name !== undefined) {
                localVarQueryParameter['name'] = name;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a count of unread messages for this user
         * @summary Counts the number of unread messages for a user
         * @param {number} id User ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        countUserUnreadMessages: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('countUserUnreadMessages', 'id', id)
            const localVarPath = `/users/{id}/messages/unread/count`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Creates a new user
         * @summary Create a user
         * @param {CreatePersonChatUserResource} createPersonChatUserResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createUser: async (createPersonChatUserResource: CreatePersonChatUserResource, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'createPersonChatUserResource' is not null or undefined
            assertParamExists('createUser', 'createPersonChatUserResource', createPersonChatUserResource)
            const localVarPath = `/users`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/vnd.chatkitty+json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(createPersonChatUserResource, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Delets a user
         * @summary Delete a user
         * @param {number} id User ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteUser: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('deleteUser', 'id', id)
            const localVarPath = `/users/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of channels for this user created or joined
         * @summary List a user\'s channels
         * @param {number} id User ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listUserChannels: async (id: number, page?: number, size?: number, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listUserChannels', 'id', id)
            const localVarPath = `/users/{id}/channels`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of messages for a user
         * @summary List a user\'s messages
         * @param {number} id User ID
         * @param {number} [size] The size of the page to be returned
         * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
         * @param {ListUserMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {boolean} [unread] Filters by returning unread messages
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listUserMessages: async (id: number, size?: number, start?: number, next?: number, relation?: ListUserMessagesRelationEnum, unread?: boolean, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listUserMessages', 'id', id)
            const localVarPath = `/users/{id}/messages`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (start !== undefined) {
                localVarQueryParameter['start'] = start;
            }

            if (next !== undefined) {
                localVarQueryParameter['next'] = next;
            }

            if (relation !== undefined) {
                localVarQueryParameter['relation'] = relation;
            }

            if (unread !== undefined) {
                localVarQueryParameter['unread'] = unread;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of notifications received by this user
         * @summary List a user\'s notifications
         * @param {number} id User ID
         * @param {number} [size] The size of the page to be returned
         * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
         * @param {ListUserNotificationsRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listUserNotifications: async (id: number, size?: number, start?: number, next?: number, relation?: ListUserNotificationsRelationEnum, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listUserNotifications', 'id', id)
            const localVarPath = `/users/{id}/notifications`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (start !== undefined) {
                localVarQueryParameter['start'] = start;
            }

            if (next !== undefined) {
                localVarQueryParameter['next'] = next;
            }

            if (relation !== undefined) {
                localVarQueryParameter['relation'] = relation;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a page of users belonging to this application
         * @summary List users
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {string} [name] Filters by username
         * @param {boolean} [unread] Filters by unread
         * @param {string} [properties] Filters by user custom properties
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listUsers: async (page?: number, size?: number, sort?: Array<string>, name?: string, unread?: boolean, properties?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/users`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)

            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }

            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }

            if (name !== undefined) {
                localVarQueryParameter['name'] = name;
            }

            if (unread !== undefined) {
                localVarQueryParameter['unread'] = unread;
            }

            if (properties !== undefined) {
                localVarQueryParameter['properties'] = properties;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Removes a user secret\'s value
         * @summary Remove a user secret
         * @param {number} id User ID
         * @param {string} name The secret\&#39;s name
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        removeUserSecret: async (id: number, name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('removeUserSecret', 'id', id)
            // verify required parameter 'name' is not null or undefined
            assertParamExists('removeUserSecret', 'name', name)
            const localVarPath = `/users/{id}/secrets/{name}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)))
                .replace(`{${"name"}}`, encodeURIComponent(String(name)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a user by ID
         * @summary Retrieve a user
         * @param {number} id User ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveUser: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('retrieveUser', 'id', id)
            const localVarPath = `/users/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Returns a user secret
         * @summary Retrieve a user secret
         * @param {number} id User ID
         * @param {string} name The secret\&#39;s name
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveUserSecret: async (id: number, name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('retrieveUserSecret', 'id', id)
            // verify required parameter 'name' is not null or undefined
            assertParamExists('retrieveUserSecret', 'name', name)
            const localVarPath = `/users/{id}/secrets/{name}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)))
                .replace(`{${"name"}}`, encodeURIComponent(String(name)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Sets a user secret\'s value
         * @summary Set a user secret
         * @param {number} id User ID
         * @param {string} name The secret\&#39;s name
         * @param {SecretResource} secretResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        setUserSecret: async (id: number, name: string, secretResource: SecretResource, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('setUserSecret', 'id', id)
            // verify required parameter 'name' is not null or undefined
            assertParamExists('setUserSecret', 'name', name)
            // verify required parameter 'secretResource' is not null or undefined
            assertParamExists('setUserSecret', 'secretResource', secretResource)
            const localVarPath = `/users/{id}/secrets/{name}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)))
                .replace(`{${"name"}}`, encodeURIComponent(String(name)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/vnd.chatkitty+json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(secretResource, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Updates a user
         * @summary Update a user
         * @param {number} id User ID
         * @param {object} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateUser: async (id: number, body?: object, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('updateUser', 'id', id)
            const localVarPath = `/users/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/json+merge-patch';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Updates a user\'s display picture
         * @summary Update a user\'s display picture
         * @param {number} id User ID
         * @param {CreateExternalFileProperties} createExternalFileProperties 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateUserDisplayPicture: async (id: number, createExternalFileProperties: CreateExternalFileProperties, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('updateUserDisplayPicture', 'id', id)
            // verify required parameter 'createExternalFileProperties' is not null or undefined
            assertParamExists('updateUserDisplayPicture', 'createExternalFileProperties', createExternalFileProperties)
            const localVarPath = `/users/{id}/display-picture`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication application_authorization required
            // oauth required
            await setOAuthToObject(localVarHeaderParameter, "application_authorization", [], configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(createExternalFileProperties, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * UsersApi - functional programming interface
 */
export const UsersApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = UsersApiAxiosParamCreator(configuration)
    return {
        /**
         * Checks if a user exists
         * @summary Check a user exists
         * @param {string} name Username of the user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async checkUserExists(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.checkUserExists(name, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UsersApi.checkUserExists']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a count of unread messages for this user
         * @summary Counts the number of unread messages for a user
         * @param {number} id User ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async countUserUnreadMessages(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CountResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.countUserUnreadMessages(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UsersApi.countUserUnreadMessages']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Creates a new user
         * @summary Create a user
         * @param {CreatePersonChatUserResource} createPersonChatUserResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createUser(createPersonChatUserResource: CreatePersonChatUserResource, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatUserResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(createPersonChatUserResource, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UsersApi.createUser']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Delets a user
         * @summary Delete a user
         * @param {number} id User ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteUser(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApplicationResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUser(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UsersApi.deleteUser']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of channels for this user created or joined
         * @summary List a user\'s channels
         * @param {number} id User ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listUserChannels(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelChannelResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listUserChannels(id, page, size, sort, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UsersApi.listUserChannels']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of messages for a user
         * @summary List a user\'s messages
         * @param {number} id User ID
         * @param {number} [size] The size of the page to be returned
         * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
         * @param {ListUserMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {boolean} [unread] Filters by returning unread messages
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listUserMessages(id: number, size?: number, start?: number, next?: number, relation?: ListUserMessagesRelationEnum, unread?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CursorPagedModelMessageResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listUserMessages(id, size, start, next, relation, unread, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UsersApi.listUserMessages']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of notifications received by this user
         * @summary List a user\'s notifications
         * @param {number} id User ID
         * @param {number} [size] The size of the page to be returned
         * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
         * @param {ListUserNotificationsRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listUserNotifications(id: number, size?: number, start?: number, next?: number, relation?: ListUserNotificationsRelationEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CursorPagedModelNotificationResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listUserNotifications(id, size, start, next, relation, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UsersApi.listUserNotifications']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a page of users belonging to this application
         * @summary List users
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {string} [name] Filters by username
         * @param {boolean} [unread] Filters by unread
         * @param {string} [properties] Filters by user custom properties
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listUsers(page?: number, size?: number, sort?: Array<string>, name?: string, unread?: boolean, properties?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PagedModelChatUserResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listUsers(page, size, sort, name, unread, properties, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UsersApi.listUsers']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Removes a user secret\'s value
         * @summary Remove a user secret
         * @param {number} id User ID
         * @param {string} name The secret\&#39;s name
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async removeUserSecret(id: number, name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatUserResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.removeUserSecret(id, name, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UsersApi.removeUserSecret']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a user by ID
         * @summary Retrieve a user
         * @param {number} id User ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveUser(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatUserResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveUser(id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UsersApi.retrieveUser']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Returns a user secret
         * @summary Retrieve a user secret
         * @param {number} id User ID
         * @param {string} name The secret\&#39;s name
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retrieveUserSecret(id: number, name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SecretResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveUserSecret(id, name, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UsersApi.retrieveUserSecret']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Sets a user secret\'s value
         * @summary Set a user secret
         * @param {number} id User ID
         * @param {string} name The secret\&#39;s name
         * @param {SecretResource} secretResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async setUserSecret(id: number, name: string, secretResource: SecretResource, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatUserResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.setUserSecret(id, name, secretResource, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UsersApi.setUserSecret']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Updates a user
         * @summary Update a user
         * @param {number} id User ID
         * @param {object} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateUser(id: number, body?: object, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatUserResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(id, body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UsersApi.updateUser']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Updates a user\'s display picture
         * @summary Update a user\'s display picture
         * @param {number} id User ID
         * @param {CreateExternalFileProperties} createExternalFileProperties 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateUserDisplayPicture(id: number, createExternalFileProperties: CreateExternalFileProperties, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatUserResource>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateUserDisplayPicture(id, createExternalFileProperties, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UsersApi.updateUserDisplayPicture']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * UsersApi - factory interface
 */
export const UsersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = UsersApiFp(configuration)
    return {
        /**
         * Checks if a user exists
         * @summary Check a user exists
         * @param {string} name Username of the user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        checkUserExists(name: string, options?: RawAxiosRequestConfig): AxiosPromise<object> {
            return localVarFp.checkUserExists(name, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a count of unread messages for this user
         * @summary Counts the number of unread messages for a user
         * @param {number} id User ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        countUserUnreadMessages(id: number, options?: RawAxiosRequestConfig): AxiosPromise<CountResource> {
            return localVarFp.countUserUnreadMessages(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Creates a new user
         * @summary Create a user
         * @param {CreatePersonChatUserResource} createPersonChatUserResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createUser(createPersonChatUserResource: CreatePersonChatUserResource, options?: RawAxiosRequestConfig): AxiosPromise<ChatUserResource> {
            return localVarFp.createUser(createPersonChatUserResource, options).then((request) => request(axios, basePath));
        },
        /**
         * Delets a user
         * @summary Delete a user
         * @param {number} id User ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteUser(id: number, options?: RawAxiosRequestConfig): AxiosPromise<ApplicationResource> {
            return localVarFp.deleteUser(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of channels for this user created or joined
         * @summary List a user\'s channels
         * @param {number} id User ID
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listUserChannels(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelChannelResource> {
            return localVarFp.listUserChannels(id, page, size, sort, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of messages for a user
         * @summary List a user\'s messages
         * @param {number} id User ID
         * @param {number} [size] The size of the page to be returned
         * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
         * @param {ListUserMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {boolean} [unread] Filters by returning unread messages
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listUserMessages(id: number, size?: number, start?: number, next?: number, relation?: ListUserMessagesRelationEnum, unread?: boolean, options?: RawAxiosRequestConfig): AxiosPromise<CursorPagedModelMessageResource> {
            return localVarFp.listUserMessages(id, size, start, next, relation, unread, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of notifications received by this user
         * @summary List a user\'s notifications
         * @param {number} id User ID
         * @param {number} [size] The size of the page to be returned
         * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
         * @param {ListUserNotificationsRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listUserNotifications(id: number, size?: number, start?: number, next?: number, relation?: ListUserNotificationsRelationEnum, options?: RawAxiosRequestConfig): AxiosPromise<CursorPagedModelNotificationResource> {
            return localVarFp.listUserNotifications(id, size, start, next, relation, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a page of users belonging to this application
         * @summary List users
         * @param {number} [page] Zero-based page index (0..N)
         * @param {number} [size] The size of the page to be returned
         * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
         * @param {string} [name] Filters by username
         * @param {boolean} [unread] Filters by unread
         * @param {string} [properties] Filters by user custom properties
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listUsers(page?: number, size?: number, sort?: Array<string>, name?: string, unread?: boolean, properties?: string, options?: RawAxiosRequestConfig): AxiosPromise<PagedModelChatUserResource> {
            return localVarFp.listUsers(page, size, sort, name, unread, properties, options).then((request) => request(axios, basePath));
        },
        /**
         * Removes a user secret\'s value
         * @summary Remove a user secret
         * @param {number} id User ID
         * @param {string} name The secret\&#39;s name
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        removeUserSecret(id: number, name: string, options?: RawAxiosRequestConfig): AxiosPromise<ChatUserResource> {
            return localVarFp.removeUserSecret(id, name, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a user by ID
         * @summary Retrieve a user
         * @param {number} id User ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveUser(id: number, options?: RawAxiosRequestConfig): AxiosPromise<ChatUserResource> {
            return localVarFp.retrieveUser(id, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a user secret
         * @summary Retrieve a user secret
         * @param {number} id User ID
         * @param {string} name The secret\&#39;s name
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retrieveUserSecret(id: number, name: string, options?: RawAxiosRequestConfig): AxiosPromise<SecretResource> {
            return localVarFp.retrieveUserSecret(id, name, options).then((request) => request(axios, basePath));
        },
        /**
         * Sets a user secret\'s value
         * @summary Set a user secret
         * @param {number} id User ID
         * @param {string} name The secret\&#39;s name
         * @param {SecretResource} secretResource 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        setUserSecret(id: number, name: string, secretResource: SecretResource, options?: RawAxiosRequestConfig): AxiosPromise<ChatUserResource> {
            return localVarFp.setUserSecret(id, name, secretResource, options).then((request) => request(axios, basePath));
        },
        /**
         * Updates a user
         * @summary Update a user
         * @param {number} id User ID
         * @param {object} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateUser(id: number, body?: object, options?: RawAxiosRequestConfig): AxiosPromise<ChatUserResource> {
            return localVarFp.updateUser(id, body, options).then((request) => request(axios, basePath));
        },
        /**
         * Updates a user\'s display picture
         * @summary Update a user\'s display picture
         * @param {number} id User ID
         * @param {CreateExternalFileProperties} createExternalFileProperties 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateUserDisplayPicture(id: number, createExternalFileProperties: CreateExternalFileProperties, options?: RawAxiosRequestConfig): AxiosPromise<ChatUserResource> {
            return localVarFp.updateUserDisplayPicture(id, createExternalFileProperties, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * UsersApi - object-oriented interface
 */
export class UsersApi extends BaseAPI {
    /**
     * Checks if a user exists
     * @summary Check a user exists
     * @param {string} name Username of the user
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public checkUserExists(name: string, options?: RawAxiosRequestConfig) {
        return UsersApiFp(this.configuration).checkUserExists(name, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a count of unread messages for this user
     * @summary Counts the number of unread messages for a user
     * @param {number} id User ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public countUserUnreadMessages(id: number, options?: RawAxiosRequestConfig) {
        return UsersApiFp(this.configuration).countUserUnreadMessages(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Creates a new user
     * @summary Create a user
     * @param {CreatePersonChatUserResource} createPersonChatUserResource 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public createUser(createPersonChatUserResource: CreatePersonChatUserResource, options?: RawAxiosRequestConfig) {
        return UsersApiFp(this.configuration).createUser(createPersonChatUserResource, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Delets a user
     * @summary Delete a user
     * @param {number} id User ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public deleteUser(id: number, options?: RawAxiosRequestConfig) {
        return UsersApiFp(this.configuration).deleteUser(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of channels for this user created or joined
     * @summary List a user\'s channels
     * @param {number} id User ID
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listUserChannels(id: number, page?: number, size?: number, sort?: Array<string>, options?: RawAxiosRequestConfig) {
        return UsersApiFp(this.configuration).listUserChannels(id, page, size, sort, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of messages for a user
     * @summary List a user\'s messages
     * @param {number} id User ID
     * @param {number} [size] The size of the page to be returned
     * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
     * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
     * @param {ListUserMessagesRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
     * @param {boolean} [unread] Filters by returning unread messages
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listUserMessages(id: number, size?: number, start?: number, next?: number, relation?: ListUserMessagesRelationEnum, unread?: boolean, options?: RawAxiosRequestConfig) {
        return UsersApiFp(this.configuration).listUserMessages(id, size, start, next, relation, unread, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of notifications received by this user
     * @summary List a user\'s notifications
     * @param {number} id User ID
     * @param {number} [size] The size of the page to be returned
     * @param {number} [start] Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
     * @param {number} [next] Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages
     * @param {ListUserNotificationsRelationEnum} [relation] Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listUserNotifications(id: number, size?: number, start?: number, next?: number, relation?: ListUserNotificationsRelationEnum, options?: RawAxiosRequestConfig) {
        return UsersApiFp(this.configuration).listUserNotifications(id, size, start, next, relation, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a page of users belonging to this application
     * @summary List users
     * @param {number} [page] Zero-based page index (0..N)
     * @param {number} [size] The size of the page to be returned
     * @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
     * @param {string} [name] Filters by username
     * @param {boolean} [unread] Filters by unread
     * @param {string} [properties] Filters by user custom properties
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listUsers(page?: number, size?: number, sort?: Array<string>, name?: string, unread?: boolean, properties?: string, options?: RawAxiosRequestConfig) {
        return UsersApiFp(this.configuration).listUsers(page, size, sort, name, unread, properties, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Removes a user secret\'s value
     * @summary Remove a user secret
     * @param {number} id User ID
     * @param {string} name The secret\&#39;s name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public removeUserSecret(id: number, name: string, options?: RawAxiosRequestConfig) {
        return UsersApiFp(this.configuration).removeUserSecret(id, name, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a user by ID
     * @summary Retrieve a user
     * @param {number} id User ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveUser(id: number, options?: RawAxiosRequestConfig) {
        return UsersApiFp(this.configuration).retrieveUser(id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a user secret
     * @summary Retrieve a user secret
     * @param {number} id User ID
     * @param {string} name The secret\&#39;s name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public retrieveUserSecret(id: number, name: string, options?: RawAxiosRequestConfig) {
        return UsersApiFp(this.configuration).retrieveUserSecret(id, name, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Sets a user secret\'s value
     * @summary Set a user secret
     * @param {number} id User ID
     * @param {string} name The secret\&#39;s name
     * @param {SecretResource} secretResource 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public setUserSecret(id: number, name: string, secretResource: SecretResource, options?: RawAxiosRequestConfig) {
        return UsersApiFp(this.configuration).setUserSecret(id, name, secretResource, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Updates a user
     * @summary Update a user
     * @param {number} id User ID
     * @param {object} [body] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public updateUser(id: number, body?: object, options?: RawAxiosRequestConfig) {
        return UsersApiFp(this.configuration).updateUser(id, body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Updates a user\'s display picture
     * @summary Update a user\'s display picture
     * @param {number} id User ID
     * @param {CreateExternalFileProperties} createExternalFileProperties 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public updateUserDisplayPicture(id: number, createExternalFileProperties: CreateExternalFileProperties, options?: RawAxiosRequestConfig) {
        return UsersApiFp(this.configuration).updateUserDisplayPicture(id, createExternalFileProperties, options).then((request) => request(this.axios, this.basePath));
    }
}

export const ListUserMessagesRelationEnum = {
    Self: 'SELF',
    Previous: 'PREVIOUS',
    Next: 'NEXT'
} as const;
export type ListUserMessagesRelationEnum = typeof ListUserMessagesRelationEnum[keyof typeof ListUserMessagesRelationEnum];
export const ListUserNotificationsRelationEnum = {
    Self: 'SELF',
    Previous: 'PREVIOUS',
    Next: 'NEXT'
} as const;
export type ListUserNotificationsRelationEnum = typeof ListUserNotificationsRelationEnum[keyof typeof ListUserNotificationsRelationEnum];


