```diff
--- test_files/483-original.txt	2025-03-07 19:07:03
+++ test_files/483-modified.txt	2025-03-07 19:07:03
@@ -1,148 +1,281 @@
-import { AppConnectorControllerDeleteConnectorData } from "../client";
-import apiClient from "../client/client"
-import { BackendClient } from "./backendClient";
+import { z } from "zod";
 
-export type ListAllIntegrationsData = {
-    /**
-     * Page number to fetch
-     */
-    page?: number;
-    /**
-     * Page Size to assume
-     */
-    pageSize?: number;
-};
+import {
+  DeleteRowAPIDTO,
+  ExpectedInputFieldsDTO,
+  GetConnectorInfoResDTO,
+  GetConnectorListResDTO,
+} from "../client";
+import apiClient from "../client/client";
+import {
+  ZAuthMode,
+  ZCreateIntegrationParams,
+  ZListIntegrationsParams,
+  ZSingleIntegrationParams,
+} from "../types/integration";
+import { CEG } from "../utils/error";
+import { COMPOSIO_SDK_ERROR_CODES } from "../utils/errors/src/constants";
+import { TELEMETRY_LOGGER } from "../utils/telemetry";
+import { TELEMETRY_EVENTS } from "../utils/telemetry/events";
+import { Apps } from "./apps";
+import { AxiosBackendClient } from "./backendClient";
 
-export type GetIntegrationData = {
-    /**
-     * The unique identifier of the integration.
-     */
-    integrationId: string;
+// Types generated from zod schemas
+
+export type IntegrationGetRequiredParam = z.infer<
+  typeof ZSingleIntegrationParams
+>;
+export type IntegrationCreateParams = z.infer<
+  typeof ZCreateIntegrationParams
+> & {
+  /** @deprecated use appUniqueKey field instead */
+  appId?: string;
 };
+export type IntegrationListParam = z.infer<typeof ZListIntegrationsParams> & {
+  /** @deprecated use appUniqueKeys field instead */
+  appName?: string;
+};
+type IntegrationDeleteParam = z.infer<typeof ZSingleIntegrationParams>;
 
-export type CreateIntegrationData = {
-    requestBody?: {
-        /**
-         * The name of the connector.
-         */
-        name?: string;
-        /**
-         * The authentication scheme used by the connector (e.g., "OAUTH2", "API_KEY").
-         */
-        authScheme?: string;
-        /**
-         * The unique identifier of the app associated with the connector.
-         */
-        appId?: string;
-        forceNewIntegration?: boolean;
-        /**
-         * An object containing the authentication configuration for the connector.
-         */
-        authConfig?: {
-            /**
-             * The client ID used for authentication with the app - if authScheme is OAUTH2
-             */
-            client_id?: string;
-            /**
-             * The client secret used for authentication with the app - if authScheme is OAUTH2
-             */
-            client_secret?: string;
-            /**
-             * The API key used for authentication with the app - if authScheme is API_KEY
-             */
-            api_key?: string;
-            /**
-             * The Consumer key used for authentication with the app - if authScheme is OAUTH1
-             */
-            consumer_key?: string;
-            /**
-             * The Consumer secret used for authentication with the app - if authScheme is OAUTH1
-             */
-            consumer_secret?: string;
-            /**
-             *  The base URL for making API requests to the app.
-             */
-            base_url?: string;
-
-            [key: string]: unknown;
-        };
-        /**
-         * Use default Composio credentials to proceed. The developer app credentials will be of Composio.
-         */
-        useComposioAuth?: boolean;
-    };
+// API response types
+export type IntegrationCreateData = {
+  requestBody?: IntegrationCreateParams;
 };
 
+export type IntegrationListRes = GetConnectorListResDTO;
+export type IntegrationGetRes = GetConnectorInfoResDTO;
+export type IntegrationRequiredParamsRes = ExpectedInputFieldsDTO[];
+export type IntegrationDeleteRes = DeleteRowAPIDTO;
 
 export class Integrations {
+  private backendClient: AxiosBackendClient;
+  private fileName: string = "js/src/sdk/models/integrations.ts";
+  private apps: Apps;
 
-    backendClient: BackendClient;
+  constructor(backendClient: AxiosBackendClient) {
+    this.backendClient = backendClient;
+    this.apps = new Apps(backendClient);
+  }
 
-    constructor(backendClient: BackendClient) {
-        this.backendClient = backendClient;
+  /**
+   * Retrieves a list of all available integrations in the Composio platform.
+   *
+   * This method allows clients to explore and discover the supported integrations. It returns an array of integration objects, each containing essential details such as the integration's key, name, description, logo, categories, and unique identifier.
+   *
+   * @returns {Promise<IntegrationListRes>} A promise that resolves to the list of all integrations.
+   * @throws {ComposioError} If the request fails.
+   */
+  async list(data: IntegrationListParam = {}): Promise<IntegrationListRes> {
+    TELEMETRY_LOGGER.manualTelemetry(TELEMETRY_EVENTS.SDK_METHOD_INVOKED, {
+      method: "list",
+      file: this.fileName,
+      params: { data },
+    });
+    try {
+      const { appName, appUniqueKey, ...rest } =
+        ZListIntegrationsParams.parse(data);
+      const finalAppName =
+        appName && appName.length > 0 ? appName : appUniqueKey;
+      const response = await apiClient.appConnector.listAllConnectors({
+        query: { ...rest, appName: finalAppName },
+        throwOnError: true,
+      });
+
+      return response.data;
+    } catch (error) {
+      throw CEG.handleAllError(error);
     }
+  }
 
-    /**
-     * Retrieves a list of all available integrations in the Composio platform.
-     * 
-     * This method allows clients to explore and discover the supported integrations. It returns an array of integration objects, each containing essential details such as the integration's key, name, description, logo, categories, and unique identifier.
-     * 
-     * @returns {Promise<ListAllIntegrationsResponse>} A promise that resolves to the list of all integrations.
-     * @throws {ApiError} If the request fails.
-     */
-    list(data: ListAllIntegrationsData = {}) {
-        return apiClient.appConnector.listGlobalConnectors({
-            query: data
-        }).then(res=>res.data)
+  /**
+   * Retrieves details of a specific integration in the Composio platform by providing its integration name.
+   *
+   * The response includes the integration's name, display name, description, input parameters, expected response, associated app information, and enabled status.
+   *
+   * @param {IntegrationGetParam} data The data for the request.
+   * @returns {Promise<IntegrationGetResponse>} A promise that resolves to the details of the integration.
+   * @throws {ComposioError} If the request fails.
+   */
+  async get(data: IntegrationGetRequiredParam): Promise<IntegrationGetRes> {
+    TELEMETRY_LOGGER.manualTelemetry(TELEMETRY_EVENTS.SDK_METHOD_INVOKED, {
+      method: "get",
+      file: this.fileName,
+      params: { data },
+    });
+    try {
+      const response = await apiClient.appConnector.getConnectorInfo({
+        path: data,
+        throwOnError: true,
+      });
+      return response.data;
+    } catch (error) {
+      throw CEG.handleAllError(error);
     }
+  }
 
-    /**
-     * Retrieves details of a specific integration in the Composio platform by providing its integration name.
-     * 
-     * The response includes the integration's name, display name, description, input parameters, expected response, associated app information, and enabled status.
-     * 
-     * @param {GetIntegrationData} data The data for the request.
-     * @returns {CancelablePromise<GetIntegrationResponse>} A promise that resolves to the details of the integration.
-     * @throws {ApiError} If the request fails.
-     */
-    get(data: GetIntegrationData): any {
-        return apiClient.appConnector.getConnectorInfo({
-            path: data
-        }).then(res => res.data)
+  /**
+   * Retrieves the required parameters for a specific integration's authentication scheme.
+   *
+   * This method is used to get the necessary input fields for a specific integration's authentication scheme.
+   *
+   * @param {IntegrationGetParam} data The data for the request.
+   * @returns {Promise<IntegrationRequiredParamsRes>} A promise that resolves to the required parameters for the integration's authentication scheme.
+   * @throws {ComposioError} If the request fails.
+   */
+  async getRequiredParams(
+    data: IntegrationGetRequiredParam
+  ): Promise<IntegrationRequiredParamsRes> {
+    TELEMETRY_LOGGER.manualTelemetry(TELEMETRY_EVENTS.SDK_METHOD_INVOKED, {
+      method: "getRequiredParams",
+      file: this.fileName,
+      params: { data },
+    });
+    try {
+      ZSingleIntegrationParams.parse(data);
+      const response = await apiClient.appConnector.getConnectorInfo({
+        path: {
+          integrationId: data.integrationId,
+        },
+        throwOnError: true,
+      });
+      return response.data?.expectedInputFields;
+    } catch (error) {
+      throw CEG.handleAllError(error);
     }
+  }
 
-    /**
-     * Creates a new integration in the Composio platform.
-     * 
-     * This method allows clients to create a new integration by providing the necessary details such as app ID, name, authentication mode, and configuration.
-     * 
-     * @param {CreateIntegrationData["requestBody"]} data The data for the request.
-     * @returns {CancelablePromise<CreateIntegrationResponse>} A promise that resolves to the created integration model.
-     * @throws {ApiError} If the request fails.
-     */
-    create(
-        data: CreateIntegrationData["requestBody"]
-    ): any {
+  /**
+   * Creates a new integration in the Composio platform.
+   *
+   * This method allows clients to create a new integration by providing the necessary details such as app ID, name, authentication mode, and configuration.
+   *
+   * @param {IntegrationCreateParams} data The data for the request.
+   * @returns {Promise<IntegrationGetResponse>} A promise that resolves to the created integration model.
+   * @throws {ComposioError} If the request fails.
+   */
+  async create(data: IntegrationCreateParams): Promise<IntegrationGetRes> {
+    TELEMETRY_LOGGER.manualTelemetry(TELEMETRY_EVENTS.SDK_METHOD_INVOKED, {
+      method: "create",
+      file: this.fileName,
+      params: { data },
+    });
+    try {
+      ZCreateIntegrationParams.parse(data);
 
-        if (!data?.authConfig) {
-            data!.authConfig = {};
-        }
+      let uniqueKey = data.appUniqueKey;
 
-        return apiClient.appConnector.createConnector({
-            body: {
-                name: data?.name!,
-                appId: data?.appId!,
-                authConfig: data?.authConfig! as any,
-                authScheme: data?.authScheme,
-                useComposioAuth: data?.useComposioAuth!,
-                forceNewIntegration: true
+      if (!uniqueKey) {
+        const apps = await apiClient.apps.getApps();
+        const app = apps.data?.items.find((app) => app.appId === data.appId);
+        uniqueKey = app!.key;
+        if (!uniqueKey) {
+          throw CEG.getCustomError(
+            COMPOSIO_SDK_ERROR_CODES.COMMON.INVALID_PARAMS_PASSED,
+            {
+              message: `No app was found with the provided appId`,
+              description: `Please provide an app unique key`,
             }
-        }).then(res=>{
-            return res.data
-        });
+          );
+        }
+      }
+
+      const response = await apiClient.appConnectorV2.createConnectorV2({
+        body: {
+          app: {
+            uniqueKey: uniqueKey,
+          },
+          config: {
+            useComposioAuth: data.useComposioAuth,
+            name: data.name,
+            authScheme: data.authScheme as z.infer<typeof ZAuthMode>,
+            integrationSecrets: data.authConfig,
+          },
+        },
+        throwOnError: true,
+      });
+
+      const integrationId = response.data.integrationId;
+      return this.get({ integrationId });
+    } catch (error) {
+      throw CEG.handleAllError(error);
     }
+  }
 
-    delete(data: AppConnectorControllerDeleteConnectorData): any {
-        return apiClient.appConnector.deleteConnector(data).then(res=>res.data)
-    }   
+  async getOrCreateIntegration(
+    data: IntegrationCreateParams
+  ): Promise<IntegrationGetRes> {
+    TELEMETRY_LOGGER.manualTelemetry(TELEMETRY_EVENTS.SDK_METHOD_INVOKED, {
+      method: "getOrCreateIntegration",
+      file: this.fileName,
+      params: { data },
+    });
+
+    try {
+      ZCreateIntegrationParams.parse(data);
+
+      let uniqueKey = data.appUniqueKey;
+
+      if (!uniqueKey) {
+        const apps = await apiClient.apps.getApps();
+        const app = apps.data?.items.find((app) => app.appId === data.appId);
+        uniqueKey = app!.key;
+        throw CEG.getCustomError(
+          COMPOSIO_SDK_ERROR_CODES.COMMON.INVALID_PARAMS_PASSED,
+          {
+            message: `No app was found with the provided appId`,
+            description: `Please provide an app unique key`,
+          }
+        );
+      }
+
+      const response = await apiClient.appConnectorV2.getOrCreateConnector({
+        body: {
+          app: {
+            uniqueKey,
+          },
+          config: {
+            useComposioAuth: data.useComposioAuth,
+            name: data.name,
+            authScheme: data.authScheme as z.infer<typeof ZAuthMode>,
+            integrationSecrets: data.authConfig,
+          },
+        },
+        throwOnError: true,
+      });
+
+      const integrationId = response.data.integrationId;
+      return this.get({ integrationId });
+    } catch (error) {
+      throw CEG.handleAllError(error);
+    }
+  }
+
+  /**
+   * Deletes an existing integration in the Composio platform.
+   *
+   * This method allows clients to delete an existing integration by providing its integration ID.
+   *
+   * @param {IntegrationListData} data The data for the request.
+   * @returns {Promise<IntegrationDeleteResponse>} A promise that resolves to the deleted integration model.
+   * @throws {ComposioError} If the request fails.
+   */
+  async delete(data: IntegrationDeleteParam): Promise<IntegrationDeleteRes> {
+    TELEMETRY_LOGGER.manualTelemetry(TELEMETRY_EVENTS.SDK_METHOD_INVOKED, {
+      method: "delete",
+      file: this.fileName,
+      params: { data },
+    });
+    try {
+      ZSingleIntegrationParams.parse(data);
+      const response = await apiClient.appConnector.deleteConnector({
+        path: {
+          integrationId: data.integrationId,
+        },
+        throwOnError: true,
+      });
+      return response.data;
+    } catch (error) {
+      throw CEG.handleAllError(error);
+    }
+  }
 }
```
