// This file is auto-generated by @hey-api/openapi-ts

import * as z from 'zod';

import {
  type Client,
  type ClientMeta,
  formDataBodySerializer,
  type Options as Options2,
  type RequestResult,
  type TDataShape,
} from './client';
import { client } from './client.gen';
import type {
  AuthenticateUserData,
  AuthenticateUserErrors,
  AuthenticateUserResponses,
  BackupData,
  BackupErrors,
  BackupResponses,
  CreateKubernetesIngressData,
  CreateKubernetesIngressErrors,
  CreateKubernetesIngressResponses,
  CreateKubernetesNamespaceData,
  CreateKubernetesNamespaceErrors,
  CreateKubernetesNamespaceResponses,
  CreateKubernetesServiceData,
  CreateKubernetesServiceErrors,
  CreateKubernetesServiceResponses,
  CurrentUserInspectData,
  CurrentUserInspectErrors,
  CurrentUserInspectResponses,
  CustomTemplateCreateFileData,
  CustomTemplateCreateFileErrors,
  CustomTemplateCreateFileResponses,
  CustomTemplateCreateRepositoryData,
  CustomTemplateCreateRepositoryErrors,
  CustomTemplateCreateRepositoryResponses,
  CustomTemplateCreateStringData,
  CustomTemplateCreateStringErrors,
  CustomTemplateCreateStringResponses,
  CustomTemplateDeleteData,
  CustomTemplateDeleteErrors,
  CustomTemplateDeleteResponses,
  CustomTemplateFileData,
  CustomTemplateFileErrors,
  CustomTemplateFileResponses,
  CustomTemplateGitFetchData,
  CustomTemplateGitFetchErrors,
  CustomTemplateGitFetchResponses,
  CustomTemplateInspectData,
  CustomTemplateInspectErrors,
  CustomTemplateInspectResponses,
  CustomTemplateListData,
  CustomTemplateListErrors,
  CustomTemplateListResponses,
  CustomTemplateUpdateData,
  CustomTemplateUpdateErrors,
  CustomTemplateUpdateResponses,
  DeleteClusterRoleBindingsData,
  DeleteClusterRoleBindingsErrors,
  DeleteClusterRoleBindingsResponses,
  DeleteClusterRolesData,
  DeleteClusterRolesErrors,
  DeleteClusterRolesResponses,
  DeleteCronJobsData,
  DeleteCronJobsErrors,
  DeleteCronJobsResponses,
  DeleteJobsData,
  DeleteJobsErrors,
  DeleteJobsResponses,
  DeleteKubernetesIngressesData,
  DeleteKubernetesIngressesErrors,
  DeleteKubernetesIngressesResponses,
  DeleteKubernetesNamespaceData,
  DeleteKubernetesNamespaceErrors,
  DeleteKubernetesNamespaceResponses,
  DeleteKubernetesPersistentVolumeClaimsData,
  DeleteKubernetesPersistentVolumeClaimsErrors,
  DeleteKubernetesPersistentVolumeClaimsResponses,
  DeleteKubernetesPersistentVolumesData,
  DeleteKubernetesPersistentVolumesErrors,
  DeleteKubernetesPersistentVolumesResponses,
  DeleteKubernetesPodData,
  DeleteKubernetesPodErrors,
  DeleteKubernetesPodResponses,
  DeleteKubernetesServicesData,
  DeleteKubernetesServicesErrors,
  DeleteKubernetesServicesResponses,
  DeleteKubernetesStorageClassesData,
  DeleteKubernetesStorageClassesErrors,
  DeleteKubernetesStorageClassesResponses,
  DeleteRoleBindingsData,
  DeleteRoleBindingsErrors,
  DeleteRoleBindingsResponses,
  DeleteRolesData,
  DeleteRolesErrors,
  DeleteRolesResponses,
  DeleteServiceAccountsData,
  DeleteServiceAccountsErrors,
  DeleteServiceAccountsResponses,
  DeleteWebhooksByIdData,
  DeleteWebhooksByIdErrors,
  DeleteWebhooksByIdResponses,
  DescribeResourceData,
  DescribeResourceErrors,
  DescribeResourceResponses,
  DockerContainerGpusInspectData,
  DockerContainerGpusInspectErrors,
  DockerContainerGpusInspectResponses,
  DockerDashboardData,
  DockerDashboardErrors,
  DockerDashboardResponses,
  DockerImagesListData,
  DockerImagesListErrors,
  DockerImagesListResponses,
  DrainNodeData,
  DrainNodeErrors,
  DrainNodeResponses,
  EdgeGroupCreateData,
  EdgeGroupCreateErrors,
  EdgeGroupCreateResponses,
  EdgeGroupDeleteData,
  EdgeGroupDeleteErrors,
  EdgeGroupDeleteResponses,
  EdgeGroupInspectData,
  EdgeGroupInspectErrors,
  EdgeGroupInspectResponses,
  EdgeGroupListData,
  EdgeGroupListErrors,
  EdgeGroupListResponses,
  EdgeGroupUpdateData,
  EdgeGroupUpdateErrors,
  EdgeGroupUpdateResponses,
  EdgeJobCreateFileData,
  EdgeJobCreateFileErrors,
  EdgeJobCreateFileResponses,
  EdgeJobCreateStringData,
  EdgeJobCreateStringErrors,
  EdgeJobCreateStringResponses,
  EdgeJobDeleteData,
  EdgeJobDeleteErrors,
  EdgeJobDeleteResponses,
  EdgeJobFileData,
  EdgeJobFileErrors,
  EdgeJobFileResponses,
  EdgeJobInspectData,
  EdgeJobInspectErrors,
  EdgeJobInspectResponses,
  EdgeJobListData,
  EdgeJobListErrors,
  EdgeJobListResponses,
  EdgeJobTaskLogsInspectData,
  EdgeJobTaskLogsInspectErrors,
  EdgeJobTaskLogsInspectResponses,
  EdgeJobTasksClearData,
  EdgeJobTasksClearErrors,
  EdgeJobTasksClearResponses,
  EdgeJobTasksCollectData,
  EdgeJobTasksCollectErrors,
  EdgeJobTasksCollectResponses,
  EdgeJobTasksListData,
  EdgeJobTasksListErrors,
  EdgeJobTasksListResponses,
  EdgeJobUpdateData,
  EdgeJobUpdateErrors,
  EdgeJobUpdateResponses,
  EdgeStackCreateFileData,
  EdgeStackCreateFileErrors,
  EdgeStackCreateFileResponses,
  EdgeStackCreateRepositoryData,
  EdgeStackCreateRepositoryErrors,
  EdgeStackCreateRepositoryResponses,
  EdgeStackCreateStringData,
  EdgeStackCreateStringErrors,
  EdgeStackCreateStringResponses,
  EdgeStackDeleteData,
  EdgeStackDeleteErrors,
  EdgeStackDeleteResponses,
  EdgeStackFileData,
  EdgeStackFileErrors,
  EdgeStackFileResponses,
  EdgeStackInspectData,
  EdgeStackInspectErrors,
  EdgeStackInspectResponses,
  EdgeStackListData,
  EdgeStackListErrors,
  EdgeStackListResponses,
  EdgeStackStatusUpdateData,
  EdgeStackStatusUpdateErrors,
  EdgeStackStatusUpdateResponses,
  EdgeStackUpdateData,
  EdgeStackUpdateErrors,
  EdgeStackUpdateResponses,
  EndpointAssociationDeleteData,
  EndpointAssociationDeleteErrors,
  EndpointAssociationDeleteResponses,
  EndpointCreateData,
  EndpointCreateErrors,
  EndpointCreateGlobalKeyData,
  EndpointCreateGlobalKeyErrors,
  EndpointCreateGlobalKeyResponses,
  EndpointCreateResponses,
  EndpointDeleteBatchData,
  EndpointDeleteBatchErrors,
  EndpointDeleteBatchResponses,
  EndpointDeleteData,
  EndpointDeleteErrors,
  EndpointDeleteResponses,
  EndpointDockerhubStatusData,
  EndpointDockerhubStatusErrors,
  EndpointDockerhubStatusResponses,
  EndpointForceUpdateServiceData,
  EndpointForceUpdateServiceErrors,
  EndpointForceUpdateServiceResponses,
  EndpointGroupAddEndpointData,
  EndpointGroupAddEndpointErrors,
  EndpointGroupAddEndpointResponses,
  EndpointGroupDeleteData,
  EndpointGroupDeleteEndpointData,
  EndpointGroupDeleteEndpointErrors,
  EndpointGroupDeleteEndpointResponses,
  EndpointGroupDeleteErrors,
  EndpointGroupDeleteResponses,
  EndpointGroupListData,
  EndpointGroupListErrors,
  EndpointGroupListResponses,
  EndpointGroupUpdateData,
  EndpointGroupUpdateErrors,
  EndpointGroupUpdateResponses,
  EndpointInspectData,
  EndpointInspectErrors,
  EndpointInspectResponses,
  EndpointListData,
  EndpointListErrors,
  EndpointListResponses,
  EndpointRegistriesListData,
  EndpointRegistriesListErrors,
  EndpointRegistriesListResponses,
  EndpointRegistryAccessData,
  EndpointRegistryAccessErrors,
  EndpointRegistryAccessResponses,
  EndpointSettingsUpdateData,
  EndpointSettingsUpdateErrors,
  EndpointSettingsUpdateResponses,
  EndpointSnapshotData,
  EndpointSnapshotErrors,
  EndpointSnapshotResponses,
  EndpointSnapshotsData,
  EndpointSnapshotsErrors,
  EndpointSnapshotsResponses,
  EndpointSummaryCountsData,
  EndpointSummaryCountsErrors,
  EndpointSummaryCountsResponses,
  EndpointUpdateData,
  EndpointUpdateErrors,
  EndpointUpdateRelationsData,
  EndpointUpdateRelationsErrors,
  EndpointUpdateRelationsResponses,
  EndpointUpdateResponses,
  GetAllKubernetesApplicationsCountData,
  GetAllKubernetesApplicationsCountErrors,
  GetAllKubernetesApplicationsCountResponses,
  GetAllKubernetesApplicationsData,
  GetAllKubernetesApplicationsErrors,
  GetAllKubernetesApplicationsResponses,
  GetAllKubernetesClusterIngressesCountData,
  GetAllKubernetesClusterIngressesCountErrors,
  GetAllKubernetesClusterIngressesCountResponses,
  GetAllKubernetesClusterIngressesData,
  GetAllKubernetesClusterIngressesErrors,
  GetAllKubernetesClusterIngressesResponses,
  GetAllKubernetesClusterRoleBindingsData,
  GetAllKubernetesClusterRoleBindingsErrors,
  GetAllKubernetesClusterRoleBindingsResponses,
  GetAllKubernetesClusterRolesData,
  GetAllKubernetesClusterRolesErrors,
  GetAllKubernetesClusterRolesResponses,
  GetAllKubernetesConfigMapsCountData,
  GetAllKubernetesConfigMapsCountErrors,
  GetAllKubernetesConfigMapsCountResponses,
  GetAllKubernetesConfigMapsData,
  GetAllKubernetesConfigMapsErrors,
  GetAllKubernetesConfigMapsResponses,
  GetAllKubernetesEventsData,
  GetAllKubernetesEventsErrors,
  GetAllKubernetesEventsResponses,
  GetAllKubernetesIngressControllersData,
  GetAllKubernetesIngressControllersErrors,
  GetAllKubernetesIngressControllersResponses,
  GetAllKubernetesIngressesData,
  GetAllKubernetesIngressesErrors,
  GetAllKubernetesIngressesResponses,
  GetAllKubernetesPersistentVolumeClaimsData,
  GetAllKubernetesPersistentVolumeClaimsErrors,
  GetAllKubernetesPersistentVolumeClaimsResponses,
  GetAllKubernetesPersistentVolumesData,
  GetAllKubernetesPersistentVolumesErrors,
  GetAllKubernetesPersistentVolumesResponses,
  GetAllKubernetesServicesCountData,
  GetAllKubernetesServicesCountErrors,
  GetAllKubernetesServicesCountResponses,
  GetAllKubernetesStorageClassesData,
  GetAllKubernetesStorageClassesErrors,
  GetAllKubernetesStorageClassesResponses,
  GetAllKubernetesVolumesCountData,
  GetAllKubernetesVolumesCountErrors,
  GetAllKubernetesVolumesCountResponses,
  GetAllKubernetesVolumesData,
  GetAllKubernetesVolumesErrors,
  GetAllKubernetesVolumesResponses,
  GetApplicationsResourcesData,
  GetApplicationsResourcesErrors,
  GetApplicationsResourcesResponses,
  GetEndpointGroupsByIdData,
  GetEndpointGroupsByIdErrors,
  GetEndpointGroupsByIdResponses,
  GetKubernetesConfigData,
  GetKubernetesConfigErrors,
  GetKubernetesConfigMapData,
  GetKubernetesConfigMapErrors,
  GetKubernetesConfigMapResponses,
  GetKubernetesConfigResponses,
  GetKubernetesCronJobsData,
  GetKubernetesCronJobsErrors,
  GetKubernetesCronJobsResponses,
  GetKubernetesDashboardData,
  GetKubernetesDashboardErrors,
  GetKubernetesDashboardResponses,
  GetKubernetesEventsForNamespaceData,
  GetKubernetesEventsForNamespaceErrors,
  GetKubernetesEventsForNamespaceResponses,
  GetKubernetesIngressControllersByNamespaceData,
  GetKubernetesIngressControllersByNamespaceErrors,
  GetKubernetesIngressControllersByNamespaceResponses,
  GetKubernetesIngressData,
  GetKubernetesIngressErrors,
  GetKubernetesIngressResponses,
  GetKubernetesJobsData,
  GetKubernetesJobsErrors,
  GetKubernetesJobsResponses,
  GetKubernetesMaxResourceLimitsData,
  GetKubernetesMaxResourceLimitsErrors,
  GetKubernetesMaxResourceLimitsResponses,
  GetKubernetesMetricsForAllNodesData,
  GetKubernetesMetricsForAllNodesErrors,
  GetKubernetesMetricsForAllNodesResponses,
  GetKubernetesMetricsForAllPodsData,
  GetKubernetesMetricsForAllPodsErrors,
  GetKubernetesMetricsForAllPodsResponses,
  GetKubernetesMetricsForNodeData,
  GetKubernetesMetricsForNodeErrors,
  GetKubernetesMetricsForNodeResponses,
  GetKubernetesMetricsForPodData,
  GetKubernetesMetricsForPodErrors,
  GetKubernetesMetricsForPodResponses,
  GetKubernetesNamespaceData,
  GetKubernetesNamespaceErrors,
  GetKubernetesNamespaceResponses,
  GetKubernetesNamespacesCountData,
  GetKubernetesNamespacesCountErrors,
  GetKubernetesNamespacesCountResponses,
  GetKubernetesNamespacesData,
  GetKubernetesNamespacesErrors,
  GetKubernetesNamespacesResponses,
  GetKubernetesNodesData,
  GetKubernetesNodesErrors,
  GetKubernetesNodesLimitsData,
  GetKubernetesNodesLimitsErrors,
  GetKubernetesNodesLimitsResponses,
  GetKubernetesNodesResponses,
  GetKubernetesPersistentVolumeClaimData,
  GetKubernetesPersistentVolumeClaimErrors,
  GetKubernetesPersistentVolumeClaimResponses,
  GetKubernetesPersistentVolumeClaimsInNamespaceData,
  GetKubernetesPersistentVolumeClaimsInNamespaceErrors,
  GetKubernetesPersistentVolumeClaimsInNamespaceResponses,
  GetKubernetesPersistentVolumeData,
  GetKubernetesPersistentVolumeErrors,
  GetKubernetesPersistentVolumeResponses,
  GetKubernetesRbacStatusData,
  GetKubernetesRbacStatusErrors,
  GetKubernetesRbacStatusResponses,
  GetKubernetesRoleBindingsData,
  GetKubernetesRoleBindingsErrors,
  GetKubernetesRoleBindingsResponses,
  GetKubernetesRolesData,
  GetKubernetesRolesErrors,
  GetKubernetesRolesResponses,
  GetKubernetesSecretData,
  GetKubernetesSecretErrors,
  GetKubernetesSecretResponses,
  GetKubernetesSecretsCountData,
  GetKubernetesSecretsCountErrors,
  GetKubernetesSecretsCountResponses,
  GetKubernetesSecretsData,
  GetKubernetesSecretsErrors,
  GetKubernetesSecretsResponses,
  GetKubernetesServiceAccountData,
  GetKubernetesServiceAccountErrors,
  GetKubernetesServiceAccountResponses,
  GetKubernetesServiceAccountsData,
  GetKubernetesServiceAccountsErrors,
  GetKubernetesServiceAccountsResponses,
  GetKubernetesServicesByNamespaceData,
  GetKubernetesServicesByNamespaceErrors,
  GetKubernetesServicesByNamespaceResponses,
  GetKubernetesServicesData,
  GetKubernetesServicesErrors,
  GetKubernetesServicesResponses,
  GetKubernetesStorageClassData,
  GetKubernetesStorageClassErrors,
  GetKubernetesStorageClassResponses,
  GetKubernetesVersionData,
  GetKubernetesVersionErrors,
  GetKubernetesVersionResponses,
  GetKubernetesVolumeData,
  GetKubernetesVolumeErrors,
  GetKubernetesVolumeResponses,
  GetKubernetesVolumesInNamespaceData,
  GetKubernetesVolumesInNamespaceErrors,
  GetKubernetesVolumesInNamespaceResponses,
  GetWebhooksData,
  GetWebhooksErrors,
  GetWebhooksResponses,
  GetWebsocketAttachData,
  GetWebsocketAttachErrors,
  GetWebsocketAttachResponses,
  GetWebsocketExecData,
  GetWebsocketExecErrors,
  GetWebsocketExecResponses,
  GetWebsocketKubernetesShellData,
  GetWebsocketKubernetesShellErrors,
  GetWebsocketKubernetesShellResponses,
  GetWebsocketPodData,
  GetWebsocketPodErrors,
  GetWebsocketPodResponses,
  GitOperationRepoFilePreviewData,
  GitOperationRepoFilePreviewErrors,
  GitOperationRepoFilePreviewResponses,
  GitOpsSourceGetData,
  GitOpsSourceGetErrors,
  GitOpsSourceGetResponses,
  GitOpsSourcesCreateGitData,
  GitOpsSourcesCreateGitErrors,
  GitOpsSourcesCreateGitResponses,
  GitOpsSourcesDeleteData,
  GitOpsSourcesDeleteErrors,
  GitOpsSourcesDeleteResponses,
  GitOpsSourcesListData,
  GitOpsSourcesListErrors,
  GitOpsSourcesListResponses,
  GitOpsSourcesSummaryData,
  GitOpsSourcesSummaryErrors,
  GitOpsSourcesSummaryResponses,
  GitOpsSourcesTestByIdData,
  GitOpsSourcesTestByIdErrors,
  GitOpsSourcesTestByIdResponses,
  GitOpsSourcesTestData,
  GitOpsSourcesTestErrors,
  GitOpsSourcesTestResponses,
  GitOpsSourcesUpdateAccessData,
  GitOpsSourcesUpdateAccessErrors,
  GitOpsSourcesUpdateAccessResponses,
  GitOpsSourcesUpdateGitData,
  GitOpsSourcesUpdateGitErrors,
  GitOpsSourcesUpdateGitResponses,
  GitOpsWorkflowGetData,
  GitOpsWorkflowGetErrors,
  GitOpsWorkflowGetResponses,
  GitOpsWorkflowsListData,
  GitOpsWorkflowsListErrors,
  GitOpsWorkflowsListResponses,
  GitOpsWorkflowsSummaryData,
  GitOpsWorkflowsSummaryErrors,
  GitOpsWorkflowsSummaryResponses,
  HelmDeleteData,
  HelmDeleteErrors,
  HelmDeleteResponses,
  HelmGetData,
  HelmGetErrors,
  HelmGetHistoryData,
  HelmGetHistoryErrors,
  HelmGetHistoryResponses,
  HelmGetResponses,
  HelmInstallData,
  HelmInstallErrors,
  HelmInstallResponses,
  HelmListData,
  HelmListErrors,
  HelmListResponses,
  HelmRepoSearchData,
  HelmRepoSearchErrors,
  HelmRepoSearchResponses,
  HelmRollbackData,
  HelmRollbackErrors,
  HelmRollbackResponses,
  HelmShowData,
  HelmShowErrors,
  HelmShowResponses,
  HelmUserRepositoriesListData,
  HelmUserRepositoriesListErrors,
  HelmUserRepositoriesListResponses,
  HelmUserRepositoryCreateData,
  HelmUserRepositoryCreateErrors,
  HelmUserRepositoryCreateResponses,
  HelmUserRepositoryDeleteData,
  HelmUserRepositoryDeleteErrors,
  HelmUserRepositoryDeleteResponses,
  KubernetesNamespacesToggleSystemData,
  KubernetesNamespacesToggleSystemErrors,
  KubernetesNamespacesToggleSystemResponses,
  LdapCheckData,
  LdapCheckErrors,
  LdapCheckResponses,
  LogoutData,
  LogoutErrors,
  LogoutResponses,
  MotdData,
  MotdResponses,
  PostEndpointGroupsData,
  PostEndpointGroupsErrors,
  PostEndpointGroupsResponses,
  PostEndpointsByIdDockerV2BrowsePutData,
  PostEndpointsByIdDockerV2BrowsePutErrors,
  PostEndpointsByIdDockerV2BrowsePutResponses,
  PostWebhooksByIdData,
  PostWebhooksByIdErrors,
  PostWebhooksByIdResponses,
  PostWebhooksData,
  PostWebhooksErrors,
  PostWebhooksResponses,
  PutWebhooksByIdData,
  PutWebhooksByIdErrors,
  PutWebhooksByIdResponses,
  RegistryConfigureData,
  RegistryConfigureErrors,
  RegistryConfigureResponses,
  RegistryCreateData,
  RegistryCreateErrors,
  RegistryCreateResponses,
  RegistryDeleteData,
  RegistryDeleteErrors,
  RegistryDeleteResponses,
  RegistryInspectData,
  RegistryInspectErrors,
  RegistryInspectResponses,
  RegistryListData,
  RegistryListErrors,
  RegistryListResponses,
  RegistryPingData,
  RegistryPingErrors,
  RegistryPingResponses,
  RegistryUpdateData,
  RegistryUpdateErrors,
  RegistryUpdateResponses,
  ResizeKubernetesPersistentVolumeClaimData,
  ResizeKubernetesPersistentVolumeClaimErrors,
  ResizeKubernetesPersistentVolumeClaimResponses,
  ResourceControlCreateData,
  ResourceControlCreateErrors,
  ResourceControlCreateResponses,
  ResourceControlDeleteData,
  ResourceControlDeleteErrors,
  ResourceControlDeleteResponses,
  ResourceControlUpdateData,
  ResourceControlUpdateErrors,
  ResourceControlUpdateResponses,
  RestartKubernetesPodData,
  RestartKubernetesPodErrors,
  RestartKubernetesPodResponses,
  RestoreData,
  RestoreErrors,
  RestoreResponses,
  RoleListData,
  RoleListErrors,
  RoleListResponses,
  SetDefaultKubernetesStorageClassData,
  SetDefaultKubernetesStorageClassErrors,
  SetDefaultKubernetesStorageClassResponses,
  SettingsInspectData,
  SettingsInspectErrors,
  SettingsInspectResponses,
  SettingsPublicData,
  SettingsPublicErrors,
  SettingsPublicResponses,
  SettingsUpdateData,
  SettingsUpdateErrors,
  SettingsUpdateResponses,
  SslInspectData,
  SslInspectErrors,
  SslInspectResponses,
  SslUpdateData,
  SslUpdateErrors,
  SslUpdateResponses,
  StackAssociateData,
  StackAssociateErrors,
  StackAssociateResponses,
  StackCreateDockerStandaloneFileData,
  StackCreateDockerStandaloneFileErrors,
  StackCreateDockerStandaloneFileResponses,
  StackCreateDockerStandaloneRepositoryData,
  StackCreateDockerStandaloneRepositoryErrors,
  StackCreateDockerStandaloneRepositoryResponses,
  StackCreateDockerStandaloneStringData,
  StackCreateDockerStandaloneStringErrors,
  StackCreateDockerStandaloneStringResponses,
  StackCreateDockerSwarmFileData,
  StackCreateDockerSwarmFileErrors,
  StackCreateDockerSwarmFileResponses,
  StackCreateDockerSwarmRepositoryData,
  StackCreateDockerSwarmRepositoryErrors,
  StackCreateDockerSwarmRepositoryResponses,
  StackCreateDockerSwarmStringData,
  StackCreateDockerSwarmStringErrors,
  StackCreateDockerSwarmStringResponses,
  StackCreateKubernetesFileData,
  StackCreateKubernetesFileErrors,
  StackCreateKubernetesFileResponses,
  StackCreateKubernetesGitData,
  StackCreateKubernetesGitErrors,
  StackCreateKubernetesGitResponses,
  StackCreateKubernetesUrlData,
  StackCreateKubernetesUrlErrors,
  StackCreateKubernetesUrlResponses,
  StackDeleteData,
  StackDeleteErrors,
  StackDeleteKubernetesByNameData,
  StackDeleteKubernetesByNameErrors,
  StackDeleteKubernetesByNameResponses,
  StackDeleteResponses,
  StackFileInspectData,
  StackFileInspectErrors,
  StackFileInspectResponses,
  StackGitRedeployData,
  StackGitRedeployErrors,
  StackGitRedeployResponses,
  StackInspectData,
  StackInspectErrors,
  StackInspectResponses,
  StackListData,
  StackListErrors,
  StackListResponses,
  StackMigrateData,
  StackMigrateErrors,
  StackMigrateResponses,
  StackStartData,
  StackStartErrors,
  StackStartResponses,
  StackStopData,
  StackStopErrors,
  StackStopResponses,
  StackUpdateData,
  StackUpdateErrors,
  StackUpdateGitData,
  StackUpdateGitErrors,
  StackUpdateGitResponses,
  StackUpdateResponses,
  SystemInfoData,
  SystemInfoErrors,
  SystemInfoResponses,
  SystemNodesCountData,
  SystemNodesCountErrors,
  SystemNodesCountResponses,
  SystemStatusData,
  SystemStatusResponses,
  SystemUpgradeData,
  SystemUpgradeResponses,
  SystemVersionData,
  SystemVersionResponses,
  TagCreateData,
  TagCreateErrors,
  TagCreateResponses,
  TagDeleteData,
  TagDeleteErrors,
  TagDeleteResponses,
  TagListData,
  TagListErrors,
  TagListResponses,
  TeamCreateData,
  TeamCreateErrors,
  TeamCreateResponses,
  TeamDeleteData,
  TeamDeleteErrors,
  TeamDeleteResponses,
  TeamInspectData,
  TeamInspectErrors,
  TeamInspectResponses,
  TeamListData,
  TeamListErrors,
  TeamListResponses,
  TeamMembershipCreateData,
  TeamMembershipCreateErrors,
  TeamMembershipCreateResponses,
  TeamMembershipDeleteData,
  TeamMembershipDeleteErrors,
  TeamMembershipDeleteResponses,
  TeamMembershipListData,
  TeamMembershipListErrors,
  TeamMembershipListResponses,
  TeamMembershipsData,
  TeamMembershipsErrors,
  TeamMembershipsResponses,
  TeamMembershipUpdateData,
  TeamMembershipUpdateErrors,
  TeamMembershipUpdateResponses,
  TeamUpdateData,
  TeamUpdateErrors,
  TeamUpdateResponses,
  TemplateFileData,
  TemplateFileErrors,
  TemplateFileResponses,
  TemplateListData,
  TemplateListErrors,
  TemplateListResponses,
  UpdateKubernetesIngressControllersByNamespaceData,
  UpdateKubernetesIngressControllersByNamespaceErrors,
  UpdateKubernetesIngressControllersByNamespaceResponses,
  UpdateKubernetesIngressControllersData,
  UpdateKubernetesIngressControllersErrors,
  UpdateKubernetesIngressControllersResponses,
  UpdateKubernetesIngressData,
  UpdateKubernetesIngressErrors,
  UpdateKubernetesIngressResponses,
  UpdateKubernetesNamespaceData,
  UpdateKubernetesNamespaceDeprecatedData,
  UpdateKubernetesNamespaceDeprecatedErrors,
  UpdateKubernetesNamespaceDeprecatedResponses,
  UpdateKubernetesNamespaceErrors,
  UpdateKubernetesNamespaceResponses,
  UpdateKubernetesPersistentVolumeReclaimPolicyData,
  UpdateKubernetesPersistentVolumeReclaimPolicyErrors,
  UpdateKubernetesPersistentVolumeReclaimPolicyResponses,
  UpdateKubernetesServiceAccountImagePullSecretsData,
  UpdateKubernetesServiceAccountImagePullSecretsErrors,
  UpdateKubernetesServiceAccountImagePullSecretsResponses,
  UpdateKubernetesServiceData,
  UpdateKubernetesServiceErrors,
  UpdateKubernetesServiceResponses,
  UploadTlsData,
  UploadTlsErrors,
  UploadTlsResponses,
  UserAdminCheckData,
  UserAdminCheckErrors,
  UserAdminCheckResponses,
  UserAdminInitData,
  UserAdminInitErrors,
  UserAdminInitResponses,
  UserCreateData,
  UserCreateErrors,
  UserCreateResponses,
  UserDeleteData,
  UserDeleteErrors,
  UserDeleteResponses,
  UserEffectiveAccessInspectData,
  UserEffectiveAccessInspectErrors,
  UserEffectiveAccessInspectResponses,
  UserGenerateApiKeyData,
  UserGenerateApiKeyErrors,
  UserGenerateApiKeyResponses,
  UserGetApiKeysData,
  UserGetApiKeysErrors,
  UserGetApiKeysResponses,
  UserInspectData,
  UserInspectErrors,
  UserInspectResponses,
  UserListData,
  UserListErrors,
  UserListResponses,
  UserMembershipsInspectData,
  UserMembershipsInspectErrors,
  UserMembershipsInspectResponses,
  UserRemoveApiKeyData,
  UserRemoveApiKeyErrors,
  UserRemoveApiKeyResponses,
  UserUpdateData,
  UserUpdateErrors,
  UserUpdatePasswordData,
  UserUpdatePasswordErrors,
  UserUpdatePasswordResponses,
  UserUpdateResponses,
  ValidateOAuthData,
  ValidateOAuthErrors,
  ValidateOAuthResponses,
  WebhookInvokeData,
  WebhookInvokeErrors,
  WebhookInvokeResponses,
} from './types.gen';
import {
  zAuthenticateUserBody,
  zAuthenticateUserResponse,
  zBackupBody,
  zCreateKubernetesIngressBody,
  zCreateKubernetesIngressPath,
  zCreateKubernetesIngressResponse,
  zCreateKubernetesNamespaceBody,
  zCreateKubernetesNamespacePath,
  zCreateKubernetesNamespaceResponse,
  zCreateKubernetesServiceBody,
  zCreateKubernetesServicePath,
  zCreateKubernetesServiceResponse,
  zCurrentUserInspectResponse,
  zCustomTemplateCreateFileBody,
  zCustomTemplateCreateFileResponse,
  zCustomTemplateCreateRepositoryBody,
  zCustomTemplateCreateRepositoryResponse,
  zCustomTemplateCreateStringBody,
  zCustomTemplateCreateStringResponse,
  zCustomTemplateDeletePath,
  zCustomTemplateDeleteResponse,
  zCustomTemplateFilePath,
  zCustomTemplateFileResponse,
  zCustomTemplateGitFetchPath,
  zCustomTemplateGitFetchResponse,
  zCustomTemplateInspectPath,
  zCustomTemplateInspectResponse,
  zCustomTemplateListQuery,
  zCustomTemplateListResponse,
  zCustomTemplateUpdateBody,
  zCustomTemplateUpdatePath,
  zCustomTemplateUpdateResponse,
  zDeleteClusterRoleBindingsBody,
  zDeleteClusterRoleBindingsPath,
  zDeleteClusterRoleBindingsResponse,
  zDeleteClusterRolesBody,
  zDeleteClusterRolesPath,
  zDeleteClusterRolesResponse,
  zDeleteCronJobsBody,
  zDeleteCronJobsPath,
  zDeleteCronJobsResponse,
  zDeleteJobsBody,
  zDeleteJobsPath,
  zDeleteJobsResponse,
  zDeleteKubernetesIngressesBody,
  zDeleteKubernetesIngressesPath,
  zDeleteKubernetesIngressesResponse,
  zDeleteKubernetesNamespacePath,
  zDeleteKubernetesNamespaceResponse,
  zDeleteKubernetesPersistentVolumeClaimsBody,
  zDeleteKubernetesPersistentVolumeClaimsPath,
  zDeleteKubernetesPersistentVolumeClaimsResponse,
  zDeleteKubernetesPersistentVolumesBody,
  zDeleteKubernetesPersistentVolumesPath,
  zDeleteKubernetesPersistentVolumesResponse,
  zDeleteKubernetesPodPath,
  zDeleteKubernetesPodResponse,
  zDeleteKubernetesServicesBody,
  zDeleteKubernetesServicesPath,
  zDeleteKubernetesServicesResponse,
  zDeleteKubernetesStorageClassesBody,
  zDeleteKubernetesStorageClassesPath,
  zDeleteKubernetesStorageClassesResponse,
  zDeleteRoleBindingsBody,
  zDeleteRoleBindingsPath,
  zDeleteRoleBindingsResponse,
  zDeleteRolesBody,
  zDeleteRolesPath,
  zDeleteRolesResponse,
  zDeleteServiceAccountsBody,
  zDeleteServiceAccountsPath,
  zDeleteServiceAccountsResponse,
  zDeleteWebhooksByIdPath,
  zDescribeResourcePath,
  zDescribeResourceQuery,
  zDescribeResourceResponse,
  zDockerContainerGpusInspectPath,
  zDockerContainerGpusInspectResponse,
  zDockerDashboardPath,
  zDockerDashboardResponse2,
  zDockerImagesListPath,
  zDockerImagesListQuery,
  zDockerImagesListResponse,
  zDrainNodePath,
  zDrainNodeResponse,
  zEdgeGroupCreateBody,
  zEdgeGroupCreateResponse,
  zEdgeGroupDeletePath,
  zEdgeGroupDeleteResponse,
  zEdgeGroupInspectPath,
  zEdgeGroupInspectResponse,
  zEdgeGroupListResponse,
  zEdgeGroupUpdateBody,
  zEdgeGroupUpdatePath,
  zEdgeGroupUpdateResponse,
  zEdgeJobCreateFileBody,
  zEdgeJobCreateFileResponse,
  zEdgeJobCreateStringBody,
  zEdgeJobCreateStringResponse,
  zEdgeJobDeletePath,
  zEdgeJobDeleteResponse,
  zEdgeJobFilePath,
  zEdgeJobFileResponse,
  zEdgeJobInspectPath,
  zEdgeJobInspectResponse,
  zEdgeJobListResponse,
  zEdgeJobTaskLogsInspectPath,
  zEdgeJobTaskLogsInspectResponse,
  zEdgeJobTasksClearPath,
  zEdgeJobTasksClearResponse,
  zEdgeJobTasksCollectPath,
  zEdgeJobTasksCollectResponse,
  zEdgeJobTasksListPath,
  zEdgeJobTasksListResponse,
  zEdgeJobUpdateBody,
  zEdgeJobUpdatePath,
  zEdgeJobUpdateResponse,
  zEdgeStackCreateFileBody,
  zEdgeStackCreateFileQuery,
  zEdgeStackCreateFileResponse,
  zEdgeStackCreateRepositoryBody,
  zEdgeStackCreateRepositoryQuery,
  zEdgeStackCreateRepositoryResponse,
  zEdgeStackCreateStringBody,
  zEdgeStackCreateStringQuery,
  zEdgeStackCreateStringResponse,
  zEdgeStackDeletePath,
  zEdgeStackDeleteResponse,
  zEdgeStackFilePath,
  zEdgeStackFileResponse,
  zEdgeStackInspectPath,
  zEdgeStackInspectResponse,
  zEdgeStackListQuery,
  zEdgeStackListResponse,
  zEdgeStackStatusUpdateBody,
  zEdgeStackStatusUpdatePath,
  zEdgeStackStatusUpdateResponse,
  zEdgeStackUpdateBody,
  zEdgeStackUpdatePath,
  zEdgeStackUpdateResponse,
  zEndpointAssociationDeletePath,
  zEndpointAssociationDeleteResponse,
  zEndpointCreateBody,
  zEndpointCreateGlobalKeyResponse,
  zEndpointCreateResponse,
  zEndpointDeleteBatchBody,
  zEndpointDeleteBatchResponse,
  zEndpointDeletePath,
  zEndpointDeleteResponse,
  zEndpointDockerhubStatusPath,
  zEndpointDockerhubStatusResponse,
  zEndpointForceUpdateServiceBody,
  zEndpointForceUpdateServicePath,
  zEndpointForceUpdateServiceResponse,
  zEndpointGroupAddEndpointPath,
  zEndpointGroupAddEndpointResponse,
  zEndpointGroupDeleteEndpointPath,
  zEndpointGroupDeleteEndpointResponse,
  zEndpointGroupDeletePath,
  zEndpointGroupDeleteResponse,
  zEndpointGroupListQuery,
  zEndpointGroupListResponse,
  zEndpointGroupUpdateBody,
  zEndpointGroupUpdatePath,
  zEndpointGroupUpdateResponse,
  zEndpointInspectPath,
  zEndpointInspectQuery,
  zEndpointInspectResponse,
  zEndpointListQuery,
  zEndpointListResponse,
  zEndpointRegistriesListPath,
  zEndpointRegistriesListQuery,
  zEndpointRegistriesListResponse,
  zEndpointRegistryAccessBody,
  zEndpointRegistryAccessPath,
  zEndpointRegistryAccessResponse,
  zEndpointSettingsUpdateBody,
  zEndpointSettingsUpdatePath,
  zEndpointSettingsUpdateResponse,
  zEndpointSnapshotPath,
  zEndpointSnapshotResponse,
  zEndpointSnapshotsResponse,
  zEndpointSummaryCountsResponse,
  zEndpointUpdateBody,
  zEndpointUpdatePath,
  zEndpointUpdateRelationsBody,
  zEndpointUpdateRelationsResponse,
  zEndpointUpdateResponse,
  zGetAllKubernetesApplicationsCountPath,
  zGetAllKubernetesApplicationsCountResponse,
  zGetAllKubernetesApplicationsPath,
  zGetAllKubernetesApplicationsQuery,
  zGetAllKubernetesApplicationsResponse,
  zGetAllKubernetesClusterIngressesCountPath,
  zGetAllKubernetesClusterIngressesCountResponse,
  zGetAllKubernetesClusterIngressesPath,
  zGetAllKubernetesClusterIngressesQuery,
  zGetAllKubernetesClusterIngressesResponse,
  zGetAllKubernetesClusterRoleBindingsPath,
  zGetAllKubernetesClusterRoleBindingsResponse,
  zGetAllKubernetesClusterRolesPath,
  zGetAllKubernetesClusterRolesResponse,
  zGetAllKubernetesConfigMapsCountPath,
  zGetAllKubernetesConfigMapsCountResponse,
  zGetAllKubernetesConfigMapsPath,
  zGetAllKubernetesConfigMapsQuery,
  zGetAllKubernetesConfigMapsResponse,
  zGetAllKubernetesEventsPath,
  zGetAllKubernetesEventsQuery,
  zGetAllKubernetesEventsResponse,
  zGetAllKubernetesIngressControllersPath,
  zGetAllKubernetesIngressControllersQuery,
  zGetAllKubernetesIngressControllersResponse,
  zGetAllKubernetesIngressesPath,
  zGetAllKubernetesIngressesResponse,
  zGetAllKubernetesPersistentVolumeClaimsPath,
  zGetAllKubernetesPersistentVolumeClaimsResponse,
  zGetAllKubernetesPersistentVolumesPath,
  zGetAllKubernetesPersistentVolumesResponse,
  zGetAllKubernetesServicesCountPath,
  zGetAllKubernetesServicesCountResponse,
  zGetAllKubernetesStorageClassesPath,
  zGetAllKubernetesStorageClassesResponse,
  zGetAllKubernetesVolumesCountPath,
  zGetAllKubernetesVolumesCountResponse,
  zGetAllKubernetesVolumesPath,
  zGetAllKubernetesVolumesQuery,
  zGetAllKubernetesVolumesResponse,
  zGetApplicationsResourcesPath,
  zGetApplicationsResourcesQuery,
  zGetApplicationsResourcesResponse,
  zGetEndpointGroupsByIdPath,
  zGetEndpointGroupsByIdQuery,
  zGetEndpointGroupsByIdResponse,
  zGetKubernetesConfigMapPath,
  zGetKubernetesConfigMapResponse,
  zGetKubernetesConfigQuery,
  zGetKubernetesCronJobsPath,
  zGetKubernetesCronJobsResponse,
  zGetKubernetesDashboardPath,
  zGetKubernetesDashboardResponse,
  zGetKubernetesEventsForNamespacePath,
  zGetKubernetesEventsForNamespaceQuery,
  zGetKubernetesEventsForNamespaceResponse,
  zGetKubernetesIngressControllersByNamespacePath,
  zGetKubernetesIngressControllersByNamespaceResponse,
  zGetKubernetesIngressPath,
  zGetKubernetesIngressResponse,
  zGetKubernetesJobsPath,
  zGetKubernetesJobsQuery,
  zGetKubernetesJobsResponse,
  zGetKubernetesMaxResourceLimitsPath,
  zGetKubernetesMaxResourceLimitsResponse,
  zGetKubernetesMetricsForAllNodesPath,
  zGetKubernetesMetricsForAllNodesResponse,
  zGetKubernetesMetricsForAllPodsPath,
  zGetKubernetesMetricsForAllPodsResponse,
  zGetKubernetesMetricsForNodePath,
  zGetKubernetesMetricsForNodeResponse,
  zGetKubernetesMetricsForPodPath,
  zGetKubernetesMetricsForPodResponse,
  zGetKubernetesNamespacePath,
  zGetKubernetesNamespaceQuery,
  zGetKubernetesNamespaceResponse,
  zGetKubernetesNamespacesCountPath,
  zGetKubernetesNamespacesCountResponse,
  zGetKubernetesNamespacesPath,
  zGetKubernetesNamespacesQuery,
  zGetKubernetesNamespacesResponse,
  zGetKubernetesNodesLimitsPath,
  zGetKubernetesNodesLimitsResponse,
  zGetKubernetesNodesPath,
  zGetKubernetesNodesResponse,
  zGetKubernetesPersistentVolumeClaimPath,
  zGetKubernetesPersistentVolumeClaimResponse,
  zGetKubernetesPersistentVolumeClaimsInNamespacePath,
  zGetKubernetesPersistentVolumeClaimsInNamespaceResponse,
  zGetKubernetesPersistentVolumePath,
  zGetKubernetesPersistentVolumeResponse,
  zGetKubernetesRbacStatusPath,
  zGetKubernetesRbacStatusResponse,
  zGetKubernetesRoleBindingsPath,
  zGetKubernetesRoleBindingsResponse,
  zGetKubernetesRolesPath,
  zGetKubernetesRolesResponse,
  zGetKubernetesSecretPath,
  zGetKubernetesSecretResponse,
  zGetKubernetesSecretsCountPath,
  zGetKubernetesSecretsCountResponse,
  zGetKubernetesSecretsPath,
  zGetKubernetesSecretsQuery,
  zGetKubernetesSecretsResponse,
  zGetKubernetesServiceAccountPath,
  zGetKubernetesServiceAccountResponse,
  zGetKubernetesServiceAccountsPath,
  zGetKubernetesServiceAccountsResponse,
  zGetKubernetesServicesByNamespacePath,
  zGetKubernetesServicesByNamespaceResponse,
  zGetKubernetesServicesPath,
  zGetKubernetesServicesQuery,
  zGetKubernetesServicesResponse,
  zGetKubernetesStorageClassPath,
  zGetKubernetesStorageClassResponse,
  zGetKubernetesVersionPath,
  zGetKubernetesVersionResponse,
  zGetKubernetesVolumePath,
  zGetKubernetesVolumeResponse,
  zGetKubernetesVolumesInNamespacePath,
  zGetKubernetesVolumesInNamespaceQuery,
  zGetKubernetesVolumesInNamespaceResponse,
  zGetWebhooksQuery,
  zGetWebhooksResponse,
  zGetWebsocketAttachQuery,
  zGetWebsocketExecQuery,
  zGetWebsocketKubernetesShellQuery,
  zGetWebsocketPodQuery,
  zGitOperationRepoFilePreviewBody,
  zGitOperationRepoFilePreviewResponse,
  zGitOpsSourceGetPath,
  zGitOpsSourceGetResponse,
  zGitOpsSourcesCreateGitBody,
  zGitOpsSourcesCreateGitResponse,
  zGitOpsSourcesDeletePath,
  zGitOpsSourcesDeleteResponse,
  zGitOpsSourcesListQuery,
  zGitOpsSourcesListResponse,
  zGitOpsSourcesSummaryResponse,
  zGitOpsSourcesTestBody,
  zGitOpsSourcesTestByIdBody,
  zGitOpsSourcesTestByIdPath,
  zGitOpsSourcesTestByIdResponse,
  zGitOpsSourcesTestResponse,
  zGitOpsSourcesUpdateAccessBody,
  zGitOpsSourcesUpdateAccessPath,
  zGitOpsSourcesUpdateAccessResponse,
  zGitOpsSourcesUpdateGitBody,
  zGitOpsSourcesUpdateGitPath,
  zGitOpsSourcesUpdateGitResponse,
  zGitOpsWorkflowGetPath,
  zGitOpsWorkflowGetResponse,
  zGitOpsWorkflowsListQuery,
  zGitOpsWorkflowsListResponse,
  zGitOpsWorkflowsSummaryResponse,
  zHelmDeletePath,
  zHelmDeleteQuery,
  zHelmDeleteResponse,
  zHelmGetHistoryPath,
  zHelmGetHistoryQuery,
  zHelmGetHistoryResponse,
  zHelmGetPath,
  zHelmGetQuery,
  zHelmGetResponse,
  zHelmInstallBody,
  zHelmInstallPath,
  zHelmInstallQuery,
  zHelmInstallResponse,
  zHelmListPath,
  zHelmListQuery,
  zHelmListResponse,
  zHelmRepoSearchQuery,
  zHelmRepoSearchResponse,
  zHelmRollbackPath,
  zHelmRollbackQuery,
  zHelmRollbackResponse,
  zHelmShowPath,
  zHelmShowQuery,
  zHelmShowResponse,
  zHelmUserRepositoriesListPath,
  zHelmUserRepositoriesListResponse,
  zHelmUserRepositoryCreateBody,
  zHelmUserRepositoryCreatePath,
  zHelmUserRepositoryCreateResponse,
  zHelmUserRepositoryDeletePath,
  zHelmUserRepositoryDeleteResponse,
  zKubernetesNamespacesToggleSystemBody,
  zKubernetesNamespacesToggleSystemPath,
  zKubernetesNamespacesToggleSystemResponse,
  zLdapCheckBody,
  zLdapCheckResponse,
  zLogoutResponse,
  zMotdResponse,
  zPostEndpointGroupsBody,
  zPostEndpointGroupsResponse,
  zPostEndpointsByIdDockerV2BrowsePutBody,
  zPostEndpointsByIdDockerV2BrowsePutPath,
  zPostEndpointsByIdDockerV2BrowsePutQuery,
  zPostEndpointsByIdDockerV2BrowsePutResponse,
  zPostWebhooksBody,
  zPostWebhooksByIdPath,
  zPostWebhooksResponse,
  zPutWebhooksByIdBody,
  zPutWebhooksByIdPath,
  zPutWebhooksByIdResponse,
  zRegistryConfigureBody,
  zRegistryConfigurePath,
  zRegistryConfigureResponse,
  zRegistryCreateBody,
  zRegistryCreateResponse,
  zRegistryDeletePath,
  zRegistryDeleteResponse,
  zRegistryInspectPath,
  zRegistryInspectResponse,
  zRegistryListResponse,
  zRegistryPingBody,
  zRegistryPingResponse,
  zRegistryUpdateBody,
  zRegistryUpdatePath,
  zRegistryUpdateResponse,
  zResizeKubernetesPersistentVolumeClaimBody,
  zResizeKubernetesPersistentVolumeClaimPath,
  zResizeKubernetesPersistentVolumeClaimResponse,
  zResourceControlCreateBody,
  zResourceControlCreateResponse,
  zResourceControlDeletePath,
  zResourceControlDeleteResponse,
  zResourceControlUpdateBody,
  zResourceControlUpdatePath,
  zResourceControlUpdateResponse,
  zRestartKubernetesPodPath,
  zRestartKubernetesPodResponse,
  zRestoreBody,
  zRestoreHeaders,
  zRoleListResponse,
  zSetDefaultKubernetesStorageClassPath,
  zSetDefaultKubernetesStorageClassResponse,
  zSettingsInspectResponse,
  zSettingsPublicResponse,
  zSettingsUpdateBody,
  zSettingsUpdateResponse,
  zSslInspectResponse,
  zSslUpdateBody,
  zSslUpdateResponse,
  zStackAssociatePath,
  zStackAssociateQuery,
  zStackAssociateResponse,
  zStackCreateDockerStandaloneFileBody,
  zStackCreateDockerStandaloneFileQuery,
  zStackCreateDockerStandaloneFileResponse,
  zStackCreateDockerStandaloneRepositoryBody,
  zStackCreateDockerStandaloneRepositoryQuery,
  zStackCreateDockerStandaloneRepositoryResponse,
  zStackCreateDockerStandaloneStringBody,
  zStackCreateDockerStandaloneStringQuery,
  zStackCreateDockerStandaloneStringResponse,
  zStackCreateDockerSwarmFileBody,
  zStackCreateDockerSwarmFileQuery,
  zStackCreateDockerSwarmFileResponse,
  zStackCreateDockerSwarmRepositoryBody,
  zStackCreateDockerSwarmRepositoryQuery,
  zStackCreateDockerSwarmRepositoryResponse,
  zStackCreateDockerSwarmStringBody,
  zStackCreateDockerSwarmStringQuery,
  zStackCreateDockerSwarmStringResponse,
  zStackCreateKubernetesFileBody,
  zStackCreateKubernetesFileQuery,
  zStackCreateKubernetesFileResponse,
  zStackCreateKubernetesGitBody,
  zStackCreateKubernetesGitQuery,
  zStackCreateKubernetesGitResponse,
  zStackCreateKubernetesUrlBody,
  zStackCreateKubernetesUrlQuery,
  zStackCreateKubernetesUrlResponse,
  zStackDeleteKubernetesByNamePath,
  zStackDeleteKubernetesByNameQuery,
  zStackDeleteKubernetesByNameResponse,
  zStackDeletePath,
  zStackDeleteQuery,
  zStackDeleteResponse,
  zStackFileInspectPath,
  zStackFileInspectResponse,
  zStackGitRedeployBody,
  zStackGitRedeployPath,
  zStackGitRedeployQuery,
  zStackGitRedeployResponse,
  zStackInspectPath,
  zStackInspectResponse,
  zStackListQuery,
  zStackListResponse,
  zStackMigrateBody,
  zStackMigratePath,
  zStackMigrateQuery,
  zStackMigrateResponse,
  zStackStartPath,
  zStackStartQuery,
  zStackStartResponse,
  zStackStopPath,
  zStackStopQuery,
  zStackStopResponse,
  zStackUpdateBody,
  zStackUpdateGitBody,
  zStackUpdateGitPath,
  zStackUpdateGitQuery,
  zStackUpdateGitResponse,
  zStackUpdatePath,
  zStackUpdateQuery,
  zStackUpdateResponse,
  zSystemInfoResponse,
  zSystemNodesCountResponse2,
  zSystemStatusResponse,
  zSystemUpgradeResponse,
  zSystemVersionResponse2,
  zTagCreateBody,
  zTagCreateResponse,
  zTagDeletePath,
  zTagDeleteResponse,
  zTagListResponse,
  zTeamCreateBody,
  zTeamCreateResponse,
  zTeamDeletePath,
  zTeamDeleteResponse,
  zTeamInspectPath,
  zTeamInspectResponse,
  zTeamListQuery,
  zTeamListResponse,
  zTeamMembershipCreateBody,
  zTeamMembershipCreateResponse,
  zTeamMembershipDeletePath,
  zTeamMembershipDeleteResponse,
  zTeamMembershipListResponse,
  zTeamMembershipsPath,
  zTeamMembershipsResponse,
  zTeamMembershipUpdateBody,
  zTeamMembershipUpdatePath,
  zTeamMembershipUpdateResponse,
  zTeamUpdateBody,
  zTeamUpdatePath,
  zTeamUpdateResponse,
  zTemplateFilePath,
  zTemplateFileResponse,
  zTemplateListResponse,
  zUpdateKubernetesIngressBody,
  zUpdateKubernetesIngressControllersBody,
  zUpdateKubernetesIngressControllersByNamespaceBody,
  zUpdateKubernetesIngressControllersByNamespacePath,
  zUpdateKubernetesIngressControllersByNamespaceResponse,
  zUpdateKubernetesIngressControllersPath,
  zUpdateKubernetesIngressControllersResponse,
  zUpdateKubernetesIngressPath,
  zUpdateKubernetesIngressResponse,
  zUpdateKubernetesNamespaceBody,
  zUpdateKubernetesNamespaceDeprecatedBody,
  zUpdateKubernetesNamespaceDeprecatedPath,
  zUpdateKubernetesNamespaceDeprecatedResponse,
  zUpdateKubernetesNamespacePath,
  zUpdateKubernetesNamespaceResponse,
  zUpdateKubernetesPersistentVolumeReclaimPolicyBody,
  zUpdateKubernetesPersistentVolumeReclaimPolicyPath,
  zUpdateKubernetesPersistentVolumeReclaimPolicyResponse,
  zUpdateKubernetesServiceAccountImagePullSecretsBody,
  zUpdateKubernetesServiceAccountImagePullSecretsPath,
  zUpdateKubernetesServiceAccountImagePullSecretsResponse,
  zUpdateKubernetesServiceBody,
  zUpdateKubernetesServicePath,
  zUpdateKubernetesServiceResponse,
  zUploadTlsBody,
  zUploadTlsPath,
  zUploadTlsResponse,
  zUserAdminCheckResponse,
  zUserAdminInitBody,
  zUserAdminInitHeaders,
  zUserAdminInitResponse,
  zUserCreateBody,
  zUserCreateResponse,
  zUserDeletePath,
  zUserDeleteResponse,
  zUserEffectiveAccessInspectPath,
  zUserEffectiveAccessInspectResponse,
  zUserGenerateApiKeyBody,
  zUserGenerateApiKeyPath,
  zUserGenerateApiKeyResponse,
  zUserGetApiKeysPath,
  zUserGetApiKeysResponse,
  zUserInspectPath,
  zUserInspectResponse,
  zUserListQuery,
  zUserListResponse,
  zUserMembershipsInspectPath,
  zUserMembershipsInspectResponse,
  zUserRemoveApiKeyPath,
  zUserRemoveApiKeyResponse,
  zUserUpdateBody,
  zUserUpdatePasswordBody,
  zUserUpdatePasswordPath,
  zUserUpdatePasswordResponse,
  zUserUpdatePath,
  zUserUpdateResponse,
  zValidateOAuthBody,
  zValidateOAuthResponse,
  zWebhookInvokePath,
} from './zod.gen';

export type Options<
  TData extends TDataShape = TDataShape,
  ThrowOnError extends boolean = boolean,
  TResponse = unknown,
> = Options2<TData, ThrowOnError, TResponse> & {
  /**
   * You can provide a client instance returned by `createClient()` instead of
   * individual options. This might be also useful if you want to implement a
   * custom client.
   */
  client?: Client;
  /**
   * You can pass arbitrary values through the `meta` object. This can be
   * used to access values that aren't defined as part of the SDK function.
   */
  meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
};

/**
 * Authenticate
 *
 * **Access policy**: public
 * Use this environment(endpoint) to authenticate against Portainer using a username and password.
 */
export const authenticateUser = <ThrowOnError extends boolean = true>(
  options: Options<AuthenticateUserData, ThrowOnError>
): RequestResult<
  AuthenticateUserResponses,
  AuthenticateUserErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    AuthenticateUserResponses,
    AuthenticateUserErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zAuthenticateUserBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zAuthenticateUserResponse.parseAsync(data),
    url: '/auth',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Logout
 *
 * **Access policy**: public
 */
export const logout = <ThrowOnError extends boolean = true>(
  options?: Options<LogoutData, ThrowOnError>
): RequestResult<LogoutResponses, LogoutErrors, ThrowOnError> =>
  (options?.client ?? client).post<LogoutResponses, LogoutErrors, ThrowOnError>(
    {
      requestValidator: async (data) =>
        await z
          .object({
            body: z.never().optional(),
            path: z.never().optional(),
            query: z.never().optional(),
          })
          .parseAsync(data),
      responseValidator: async (data) => await zLogoutResponse.parseAsync(data),
      security: [
        { name: 'X-API-KEY', type: 'apiKey' },
        { name: 'Authorization', type: 'apiKey' },
      ],
      url: '/auth/logout',
      ...options,
    }
  );

/**
 * Authenticate with OAuth
 *
 * **Access policy**: public
 */
export const validateOAuth = <ThrowOnError extends boolean = true>(
  options: Options<ValidateOAuthData, ThrowOnError>
): RequestResult<ValidateOAuthResponses, ValidateOAuthErrors, ThrowOnError> =>
  (options.client ?? client).post<
    ValidateOAuthResponses,
    ValidateOAuthErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zValidateOAuthBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zValidateOAuthResponse.parseAsync(data),
    url: '/auth/oauth/validate',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Creates an archive with a system data snapshot that could be used to restore the system.
 *
 * Creates an archive with a system data snapshot that could be used to restore the system.
 * **Access policy**: admin
 */
export const backup = <ThrowOnError extends boolean = true>(
  options?: Options<BackupData, ThrowOnError>
): RequestResult<BackupResponses, BackupErrors, ThrowOnError> =>
  (options?.client ?? client).post<BackupResponses, BackupErrors, ThrowOnError>(
    {
      requestValidator: async (data) =>
        await z
          .object({
            body: zBackupBody.optional(),
            path: z.never().optional(),
            query: z.never().optional(),
          })
          .parseAsync(data),
      security: [
        { name: 'X-API-KEY', type: 'apiKey' },
        { name: 'Authorization', type: 'apiKey' },
      ],
      url: '/backup',
      ...options,
      headers: {
        'Content-Type': 'application/json',
        ...options?.headers,
      },
    }
  );

/**
 * List available custom templates
 *
 * List available custom templates.
 * **Access policy**: authenticated
 */
export const customTemplateList = <ThrowOnError extends boolean = true>(
  options: Options<CustomTemplateListData, ThrowOnError>
): RequestResult<
  CustomTemplateListResponses,
  CustomTemplateListErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    CustomTemplateListResponses,
    CustomTemplateListErrors,
    ThrowOnError
  >({
    querySerializer: { parameters: { type: { array: { explode: false } } } },
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zCustomTemplateListQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zCustomTemplateListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/custom_templates',
    ...options,
  });

/**
 * Remove a template
 *
 * Remove a template.
 * **Access policy**: authenticated
 */
export const customTemplateDelete = <ThrowOnError extends boolean = true>(
  options: Options<CustomTemplateDeleteData, ThrowOnError>
): RequestResult<
  CustomTemplateDeleteResponses,
  CustomTemplateDeleteErrors,
  ThrowOnError
> =>
  (options.client ?? client).delete<
    CustomTemplateDeleteResponses,
    CustomTemplateDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zCustomTemplateDeletePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zCustomTemplateDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/custom_templates/{id}',
    ...options,
  });

/**
 * Inspect a custom template
 *
 * Retrieve details about a template.
 * **Access policy**: authenticated
 */
export const customTemplateInspect = <ThrowOnError extends boolean = true>(
  options: Options<CustomTemplateInspectData, ThrowOnError>
): RequestResult<
  CustomTemplateInspectResponses,
  CustomTemplateInspectErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    CustomTemplateInspectResponses,
    CustomTemplateInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zCustomTemplateInspectPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zCustomTemplateInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/custom_templates/{id}',
    ...options,
  });

/**
 * Update a template
 *
 * Update a template.
 * **Access policy**: authenticated
 */
export const customTemplateUpdate = <ThrowOnError extends boolean = true>(
  options: Options<CustomTemplateUpdateData, ThrowOnError>
): RequestResult<
  CustomTemplateUpdateResponses,
  CustomTemplateUpdateErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    CustomTemplateUpdateResponses,
    CustomTemplateUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zCustomTemplateUpdateBody,
          path: zCustomTemplateUpdatePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zCustomTemplateUpdateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/custom_templates/{id}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get Template stack file content.
 *
 * Retrieve the content of the Stack file for the specified custom template
 * **Access policy**: authenticated
 */
export const customTemplateFile = <ThrowOnError extends boolean = true>(
  options: Options<CustomTemplateFileData, ThrowOnError>
): RequestResult<
  CustomTemplateFileResponses,
  CustomTemplateFileErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    CustomTemplateFileResponses,
    CustomTemplateFileErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zCustomTemplateFilePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zCustomTemplateFileResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/custom_templates/{id}/file',
    ...options,
  });

/**
 * Fetch the latest config file content based on custom template's git repository configuration
 *
 * Retrieve details about a template created from git repository method.
 * **Access policy**: authenticated
 */
export const customTemplateGitFetch = <ThrowOnError extends boolean = true>(
  options: Options<CustomTemplateGitFetchData, ThrowOnError>
): RequestResult<
  CustomTemplateGitFetchResponses,
  CustomTemplateGitFetchErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    CustomTemplateGitFetchResponses,
    CustomTemplateGitFetchErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zCustomTemplateGitFetchPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zCustomTemplateGitFetchResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/custom_templates/{id}/git_fetch',
    ...options,
  });

/**
 * Create a custom template
 *
 * Create a custom template.
 * **Access policy**: authenticated
 */
export const customTemplateCreateFile = <ThrowOnError extends boolean = true>(
  options: Options<CustomTemplateCreateFileData, ThrowOnError>
): RequestResult<
  CustomTemplateCreateFileResponses,
  CustomTemplateCreateFileErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    CustomTemplateCreateFileResponses,
    CustomTemplateCreateFileErrors,
    ThrowOnError
  >({
    ...formDataBodySerializer,
    requestValidator: async (data) =>
      await z
        .object({
          body: zCustomTemplateCreateFileBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zCustomTemplateCreateFileResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/custom_templates/create/file',
    ...options,
    headers: {
      'Content-Type': null,
      ...options.headers,
    },
  });

/**
 * Create a custom template
 *
 * Create a custom template.
 * **Access policy**: authenticated
 */
export const customTemplateCreateRepository = <
  ThrowOnError extends boolean = true,
>(
  options: Options<CustomTemplateCreateRepositoryData, ThrowOnError>
): RequestResult<
  CustomTemplateCreateRepositoryResponses,
  CustomTemplateCreateRepositoryErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    CustomTemplateCreateRepositoryResponses,
    CustomTemplateCreateRepositoryErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zCustomTemplateCreateRepositoryBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zCustomTemplateCreateRepositoryResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/custom_templates/create/repository',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Create a custom template
 *
 * Create a custom template.
 * **Access policy**: authenticated
 */
export const customTemplateCreateString = <ThrowOnError extends boolean = true>(
  options: Options<CustomTemplateCreateStringData, ThrowOnError>
): RequestResult<
  CustomTemplateCreateStringResponses,
  CustomTemplateCreateStringErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    CustomTemplateCreateStringResponses,
    CustomTemplateCreateStringErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zCustomTemplateCreateStringBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zCustomTemplateCreateStringResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/custom_templates/create/string',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Fetch container gpus data
 *
 * **Access policy**:
 */
export const dockerContainerGpusInspect = <ThrowOnError extends boolean = true>(
  options: Options<DockerContainerGpusInspectData, ThrowOnError>
): RequestResult<
  DockerContainerGpusInspectResponses,
  DockerContainerGpusInspectErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    DockerContainerGpusInspectResponses,
    DockerContainerGpusInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zDockerContainerGpusInspectPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zDockerContainerGpusInspectResponse.parseAsync(data),
    security: [{ name: 'Authorization', type: 'apiKey' }],
    url: '/docker/{environmentId}/containers/{containerId}/gpus',
    ...options,
  });

/**
 * Get counters for the dashboard
 *
 * **Access policy**: restricted
 */
export const dockerDashboard = <ThrowOnError extends boolean = true>(
  options: Options<DockerDashboardData, ThrowOnError>
): RequestResult<
  DockerDashboardResponses,
  DockerDashboardErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    DockerDashboardResponses,
    DockerDashboardErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zDockerDashboardPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zDockerDashboardResponse2.parseAsync(data),
    security: [{ name: 'Authorization', type: 'apiKey' }],
    url: '/docker/{environmentId}/dashboard',
    ...options,
  });

/**
 * Fetch images
 *
 * **Access policy**:
 */
export const dockerImagesList = <ThrowOnError extends boolean = true>(
  options: Options<DockerImagesListData, ThrowOnError>
): RequestResult<
  DockerImagesListResponses,
  DockerImagesListErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    DockerImagesListResponses,
    DockerImagesListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zDockerImagesListPath,
          query: zDockerImagesListQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zDockerImagesListResponse.parseAsync(data),
    security: [{ name: 'Authorization', type: 'apiKey' }],
    url: '/docker/{environmentId}/images',
    ...options,
  });

/**
 * list EdgeGroups
 *
 * **Access policy**: administrator
 */
export const edgeGroupList = <ThrowOnError extends boolean = true>(
  options?: Options<EdgeGroupListData, ThrowOnError>
): RequestResult<EdgeGroupListResponses, EdgeGroupListErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    EdgeGroupListResponses,
    EdgeGroupListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeGroupListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_groups',
    ...options,
  });

/**
 * Create an EdgeGroup
 *
 * **Access policy**: administrator
 */
export const edgeGroupCreate = <ThrowOnError extends boolean = true>(
  options: Options<EdgeGroupCreateData, ThrowOnError>
): RequestResult<
  EdgeGroupCreateResponses,
  EdgeGroupCreateErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    EdgeGroupCreateResponses,
    EdgeGroupCreateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zEdgeGroupCreateBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeGroupCreateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_groups',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Deletes an EdgeGroup
 *
 * **Access policy**: administrator
 */
export const edgeGroupDelete = <ThrowOnError extends boolean = true>(
  options: Options<EdgeGroupDeleteData, ThrowOnError>
): RequestResult<
  EdgeGroupDeleteResponses,
  EdgeGroupDeleteErrors,
  ThrowOnError
> =>
  (options.client ?? client).delete<
    EdgeGroupDeleteResponses,
    EdgeGroupDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEdgeGroupDeletePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zEdgeGroupDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_groups/{id}',
    ...options,
  });

/**
 * Inspects an EdgeGroup
 *
 * **Access policy**: administrator
 */
export const edgeGroupInspect = <ThrowOnError extends boolean = true>(
  options: Options<EdgeGroupInspectData, ThrowOnError>
): RequestResult<
  EdgeGroupInspectResponses,
  EdgeGroupInspectErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    EdgeGroupInspectResponses,
    EdgeGroupInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEdgeGroupInspectPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeGroupInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_groups/{id}',
    ...options,
  });

/**
 * Updates an EdgeGroup
 *
 * **Access policy**: administrator
 */
export const edgeGroupUpdate = <ThrowOnError extends boolean = true>(
  options: Options<EdgeGroupUpdateData, ThrowOnError>
): RequestResult<
  EdgeGroupUpdateResponses,
  EdgeGroupUpdateErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    EdgeGroupUpdateResponses,
    EdgeGroupUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zEdgeGroupUpdateBody,
          path: zEdgeGroupUpdatePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeGroupUpdateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_groups/{id}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Fetch EdgeJobs list
 *
 * **Access policy**: administrator
 */
export const edgeJobList = <ThrowOnError extends boolean = true>(
  options?: Options<EdgeJobListData, ThrowOnError>
): RequestResult<EdgeJobListResponses, EdgeJobListErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    EdgeJobListResponses,
    EdgeJobListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeJobListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_jobs',
    ...options,
  });

/**
 * Delete an EdgeJob
 *
 * **Access policy**: administrator
 */
export const edgeJobDelete = <ThrowOnError extends boolean = true>(
  options: Options<EdgeJobDeleteData, ThrowOnError>
): RequestResult<EdgeJobDeleteResponses, EdgeJobDeleteErrors, ThrowOnError> =>
  (options.client ?? client).delete<
    EdgeJobDeleteResponses,
    EdgeJobDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEdgeJobDeletePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zEdgeJobDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_jobs/{id}',
    ...options,
  });

/**
 * Inspect an EdgeJob
 *
 * **Access policy**: administrator
 */
export const edgeJobInspect = <ThrowOnError extends boolean = true>(
  options: Options<EdgeJobInspectData, ThrowOnError>
): RequestResult<EdgeJobInspectResponses, EdgeJobInspectErrors, ThrowOnError> =>
  (options.client ?? client).get<
    EdgeJobInspectResponses,
    EdgeJobInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEdgeJobInspectPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeJobInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_jobs/{id}',
    ...options,
  });

/**
 * Update an EdgeJob
 *
 * **Access policy**: administrator
 */
export const edgeJobUpdate = <ThrowOnError extends boolean = true>(
  options: Options<EdgeJobUpdateData, ThrowOnError>
): RequestResult<EdgeJobUpdateResponses, EdgeJobUpdateErrors, ThrowOnError> =>
  (options.client ?? client).put<
    EdgeJobUpdateResponses,
    EdgeJobUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zEdgeJobUpdateBody,
          path: zEdgeJobUpdatePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeJobUpdateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_jobs/{id}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Fetch a file of an EdgeJob
 *
 * **Access policy**: administrator
 */
export const edgeJobFile = <ThrowOnError extends boolean = true>(
  options: Options<EdgeJobFileData, ThrowOnError>
): RequestResult<EdgeJobFileResponses, EdgeJobFileErrors, ThrowOnError> =>
  (options.client ?? client).get<
    EdgeJobFileResponses,
    EdgeJobFileErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEdgeJobFilePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeJobFileResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_jobs/{id}/file',
    ...options,
  });

/**
 * Fetch the list of tasks on an EdgeJob
 *
 * **Access policy**: administrator
 */
export const edgeJobTasksList = <ThrowOnError extends boolean = true>(
  options: Options<EdgeJobTasksListData, ThrowOnError>
): RequestResult<
  EdgeJobTasksListResponses,
  EdgeJobTasksListErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    EdgeJobTasksListResponses,
    EdgeJobTasksListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEdgeJobTasksListPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeJobTasksListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_jobs/{id}/tasks',
    ...options,
  });

/**
 * Clear the log for a specifc task on an EdgeJob
 *
 * **Access policy**: administrator
 */
export const edgeJobTasksClear = <ThrowOnError extends boolean = true>(
  options: Options<EdgeJobTasksClearData, ThrowOnError>
): RequestResult<
  EdgeJobTasksClearResponses,
  EdgeJobTasksClearErrors,
  ThrowOnError
> =>
  (options.client ?? client).delete<
    EdgeJobTasksClearResponses,
    EdgeJobTasksClearErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEdgeJobTasksClearPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zEdgeJobTasksClearResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_jobs/{id}/tasks/{taskID}/logs',
    ...options,
  });

/**
 * Fetch the log for a specifc task on an EdgeJob
 *
 * **Access policy**: administrator
 */
export const edgeJobTaskLogsInspect = <ThrowOnError extends boolean = true>(
  options: Options<EdgeJobTaskLogsInspectData, ThrowOnError>
): RequestResult<
  EdgeJobTaskLogsInspectResponses,
  EdgeJobTaskLogsInspectErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    EdgeJobTaskLogsInspectResponses,
    EdgeJobTaskLogsInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEdgeJobTaskLogsInspectPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeJobTaskLogsInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_jobs/{id}/tasks/{taskID}/logs',
    ...options,
  });

/**
 * Collect the log for a specifc task on an EdgeJob
 *
 * **Access policy**: administrator
 */
export const edgeJobTasksCollect = <ThrowOnError extends boolean = true>(
  options: Options<EdgeJobTasksCollectData, ThrowOnError>
): RequestResult<
  EdgeJobTasksCollectResponses,
  EdgeJobTasksCollectErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    EdgeJobTasksCollectResponses,
    EdgeJobTasksCollectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEdgeJobTasksCollectPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zEdgeJobTasksCollectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_jobs/{id}/tasks/{taskID}/logs',
    ...options,
  });

/**
 * Create an EdgeJob from a file
 *
 * **Access policy**: administrator
 */
export const edgeJobCreateFile = <ThrowOnError extends boolean = true>(
  options: Options<EdgeJobCreateFileData, ThrowOnError>
): RequestResult<
  EdgeJobCreateFileResponses,
  EdgeJobCreateFileErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    EdgeJobCreateFileResponses,
    EdgeJobCreateFileErrors,
    ThrowOnError
  >({
    ...formDataBodySerializer,
    requestValidator: async (data) =>
      await z
        .object({
          body: zEdgeJobCreateFileBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeJobCreateFileResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_jobs/create/file',
    ...options,
    headers: {
      'Content-Type': null,
      ...options.headers,
    },
  });

/**
 * Create an EdgeJob from a text
 *
 * **Access policy**: administrator
 */
export const edgeJobCreateString = <ThrowOnError extends boolean = true>(
  options: Options<EdgeJobCreateStringData, ThrowOnError>
): RequestResult<
  EdgeJobCreateStringResponses,
  EdgeJobCreateStringErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    EdgeJobCreateStringResponses,
    EdgeJobCreateStringErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zEdgeJobCreateStringBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeJobCreateStringResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_jobs/create/string',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Fetches the list of EdgeStacks
 *
 * **Access policy**: administrator
 */
export const edgeStackList = <ThrowOnError extends boolean = true>(
  options?: Options<EdgeStackListData, ThrowOnError>
): RequestResult<EdgeStackListResponses, EdgeStackListErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    EdgeStackListResponses,
    EdgeStackListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zEdgeStackListQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeStackListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_stacks',
    ...options,
  });

/**
 * Delete an EdgeStack
 *
 * **Access policy**: administrator
 */
export const edgeStackDelete = <ThrowOnError extends boolean = true>(
  options: Options<EdgeStackDeleteData, ThrowOnError>
): RequestResult<
  EdgeStackDeleteResponses,
  EdgeStackDeleteErrors,
  ThrowOnError
> =>
  (options.client ?? client).delete<
    EdgeStackDeleteResponses,
    EdgeStackDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEdgeStackDeletePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zEdgeStackDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_stacks/{id}',
    ...options,
  });

/**
 * Inspect an EdgeStack
 *
 * **Access policy**: administrator
 */
export const edgeStackInspect = <ThrowOnError extends boolean = true>(
  options: Options<EdgeStackInspectData, ThrowOnError>
): RequestResult<
  EdgeStackInspectResponses,
  EdgeStackInspectErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    EdgeStackInspectResponses,
    EdgeStackInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEdgeStackInspectPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeStackInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_stacks/{id}',
    ...options,
  });

/**
 * Update an EdgeStack
 *
 * **Access policy**: administrator
 */
export const edgeStackUpdate = <ThrowOnError extends boolean = true>(
  options: Options<EdgeStackUpdateData, ThrowOnError>
): RequestResult<
  EdgeStackUpdateResponses,
  EdgeStackUpdateErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    EdgeStackUpdateResponses,
    EdgeStackUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zEdgeStackUpdateBody,
          path: zEdgeStackUpdatePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeStackUpdateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_stacks/{id}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Fetches the stack file for an EdgeStack
 *
 * **Access policy**: administrator
 */
export const edgeStackFile = <ThrowOnError extends boolean = true>(
  options: Options<EdgeStackFileData, ThrowOnError>
): RequestResult<EdgeStackFileResponses, EdgeStackFileErrors, ThrowOnError> =>
  (options.client ?? client).get<
    EdgeStackFileResponses,
    EdgeStackFileErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEdgeStackFilePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeStackFileResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_stacks/{id}/file',
    ...options,
  });

/**
 * Update an EdgeStack status
 *
 * Authorized only if the request is done by an Edge Environment(Endpoint)
 */
export const edgeStackStatusUpdate = <ThrowOnError extends boolean = true>(
  options: Options<EdgeStackStatusUpdateData, ThrowOnError>
): RequestResult<
  EdgeStackStatusUpdateResponses,
  EdgeStackStatusUpdateErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    EdgeStackStatusUpdateResponses,
    EdgeStackStatusUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zEdgeStackStatusUpdateBody,
          path: zEdgeStackStatusUpdatePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeStackStatusUpdateResponse.parseAsync(data),
    url: '/edge_stacks/{id}/status',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Create an EdgeStack from file
 *
 * **Access policy**: administrator
 */
export const edgeStackCreateFile = <ThrowOnError extends boolean = true>(
  options: Options<EdgeStackCreateFileData, ThrowOnError>
): RequestResult<
  EdgeStackCreateFileResponses,
  EdgeStackCreateFileErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    EdgeStackCreateFileResponses,
    EdgeStackCreateFileErrors,
    ThrowOnError
  >({
    ...formDataBodySerializer,
    requestValidator: async (data) =>
      await z
        .object({
          body: zEdgeStackCreateFileBody,
          path: z.never().optional(),
          query: zEdgeStackCreateFileQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeStackCreateFileResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_stacks/create/file',
    ...options,
    headers: {
      'Content-Type': null,
      ...options.headers,
    },
  });

/**
 * Create an EdgeStack from a git repository
 *
 * **Access policy**: administrator
 */
export const edgeStackCreateRepository = <ThrowOnError extends boolean = true>(
  options: Options<EdgeStackCreateRepositoryData, ThrowOnError>
): RequestResult<
  EdgeStackCreateRepositoryResponses,
  EdgeStackCreateRepositoryErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    EdgeStackCreateRepositoryResponses,
    EdgeStackCreateRepositoryErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zEdgeStackCreateRepositoryBody,
          path: z.never().optional(),
          query: zEdgeStackCreateRepositoryQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeStackCreateRepositoryResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_stacks/create/repository',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Create an EdgeStack from a text
 *
 * **Access policy**: administrator
 */
export const edgeStackCreateString = <ThrowOnError extends boolean = true>(
  options: Options<EdgeStackCreateStringData, ThrowOnError>
): RequestResult<
  EdgeStackCreateStringResponses,
  EdgeStackCreateStringErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    EdgeStackCreateStringResponses,
    EdgeStackCreateStringErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zEdgeStackCreateStringBody,
          path: z.never().optional(),
          query: zEdgeStackCreateStringQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEdgeStackCreateStringResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/edge_stacks/create/string',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * List Environment(Endpoint) groups
 *
 * List all environment(endpoint) groups based on the current user authorizations. Will
 * return all environment(endpoint) groups if using an administrator account otherwise it will
 * only return authorized environment(endpoint) groups.
 * **Access policy**: restricted
 */
export const endpointGroupList = <ThrowOnError extends boolean = true>(
  options?: Options<EndpointGroupListData, ThrowOnError>
): RequestResult<
  EndpointGroupListResponses,
  EndpointGroupListErrors,
  ThrowOnError
> =>
  (options?.client ?? client).get<
    EndpointGroupListResponses,
    EndpointGroupListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zEndpointGroupListQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEndpointGroupListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoint_groups',
    ...options,
  });

/**
 * Create an Environment(Endpoint) Group
 *
 * Create a new environment(endpoint) group.
 * **Access policy**: administrator
 */
export const postEndpointGroups = <ThrowOnError extends boolean = true>(
  options: Options<PostEndpointGroupsData, ThrowOnError>
): RequestResult<
  PostEndpointGroupsResponses,
  PostEndpointGroupsErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    PostEndpointGroupsResponses,
    PostEndpointGroupsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zPostEndpointGroupsBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zPostEndpointGroupsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoint_groups',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Remove an environment(endpoint) group
 *
 * Remove an environment(endpoint) group.
 * **Access policy**: administrator
 */
export const endpointGroupDelete = <ThrowOnError extends boolean = true>(
  options: Options<EndpointGroupDeleteData, ThrowOnError>
): RequestResult<
  EndpointGroupDeleteResponses,
  EndpointGroupDeleteErrors,
  ThrowOnError
> =>
  (options.client ?? client).delete<
    EndpointGroupDeleteResponses,
    EndpointGroupDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEndpointGroupDeletePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zEndpointGroupDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoint_groups/{id}',
    ...options,
  });

/**
 * Inspect an Environment(Endpoint) group
 *
 * Retrieve details abont an environment(endpoint) group.
 * **Access policy**: administrator
 */
export const getEndpointGroupsById = <ThrowOnError extends boolean = true>(
  options: Options<GetEndpointGroupsByIdData, ThrowOnError>
): RequestResult<
  GetEndpointGroupsByIdResponses,
  GetEndpointGroupsByIdErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetEndpointGroupsByIdResponses,
    GetEndpointGroupsByIdErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetEndpointGroupsByIdPath,
          query: zGetEndpointGroupsByIdQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetEndpointGroupsByIdResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoint_groups/{id}',
    ...options,
  });

/**
 * Update an environment(endpoint) group
 *
 * Update an environment(endpoint) group.
 * **Access policy**: administrator
 */
export const endpointGroupUpdate = <ThrowOnError extends boolean = true>(
  options: Options<EndpointGroupUpdateData, ThrowOnError>
): RequestResult<
  EndpointGroupUpdateResponses,
  EndpointGroupUpdateErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    EndpointGroupUpdateResponses,
    EndpointGroupUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zEndpointGroupUpdateBody,
          path: zEndpointGroupUpdatePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEndpointGroupUpdateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoint_groups/{id}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Removes environment(endpoint) from an environment(endpoint) group
 *
 * **Access policy**: administrator
 */
export const endpointGroupDeleteEndpoint = <
  ThrowOnError extends boolean = true,
>(
  options: Options<EndpointGroupDeleteEndpointData, ThrowOnError>
): RequestResult<
  EndpointGroupDeleteEndpointResponses,
  EndpointGroupDeleteEndpointErrors,
  ThrowOnError
> =>
  (options.client ?? client).delete<
    EndpointGroupDeleteEndpointResponses,
    EndpointGroupDeleteEndpointErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEndpointGroupDeleteEndpointPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zEndpointGroupDeleteEndpointResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoint_groups/{id}/endpoints/{endpointId}',
    ...options,
  });

/**
 * Add an environment(endpoint) to an environment(endpoint) group
 *
 * Add an environment(endpoint) to an environment(endpoint) group
 * **Access policy**: administrator
 */
export const endpointGroupAddEndpoint = <ThrowOnError extends boolean = true>(
  options: Options<EndpointGroupAddEndpointData, ThrowOnError>
): RequestResult<
  EndpointGroupAddEndpointResponses,
  EndpointGroupAddEndpointErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    EndpointGroupAddEndpointResponses,
    EndpointGroupAddEndpointErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEndpointGroupAddEndpointPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zEndpointGroupAddEndpointResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoint_groups/{id}/endpoints/{endpointId}',
    ...options,
  });

/**
 * List environments(endpoints)
 *
 * List all environments(endpoints) based on the current user authorizations. Will
 * return all environments(endpoints) if using an administrator or team leader account otherwise it will
 * only return authorized environments(endpoints).
 * **Access policy**: restricted
 */
export const endpointList = <ThrowOnError extends boolean = true>(
  options?: Options<EndpointListData, ThrowOnError>
): RequestResult<EndpointListResponses, EndpointListErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    EndpointListResponses,
    EndpointListErrors,
    ThrowOnError
  >({
    querySerializer: {
      parameters: {
        groupIds: { array: { explode: false } },
        status: { array: { explode: false } },
        types: { array: { explode: false } },
        platformTypes: { array: { explode: false } },
        excludeGroupIds: { array: { explode: false } },
        tagIds: { array: { explode: false } },
        endpointIds: { array: { explode: false } },
        excludeIds: { array: { explode: false } },
        agentVersions: { array: { explode: false } },
        edgeGroupIds: { array: { explode: false } },
        excludeEdgeGroupIds: { array: { explode: false } },
      },
    },
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zEndpointListQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEndpointListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints',
    ...options,
  });

/**
 * Create a new environment(endpoint)
 *
 * Create a new environment(endpoint) that will be used to manage an environment(endpoint).
 * **Access policy**: administrator
 */
export const endpointCreate = <ThrowOnError extends boolean = true>(
  options: Options<EndpointCreateData, ThrowOnError>
): RequestResult<EndpointCreateResponses, EndpointCreateErrors, ThrowOnError> =>
  (options.client ?? client).post<
    EndpointCreateResponses,
    EndpointCreateErrors,
    ThrowOnError
  >({
    ...formDataBodySerializer,
    requestValidator: async (data) =>
      await z
        .object({
          body: zEndpointCreateBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEndpointCreateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints',
    ...options,
    headers: {
      'Content-Type': null,
      ...options.headers,
    },
  });

/**
 * Remove an environment
 *
 * Remove the environment associated to the specified identifier and optionally clean-up associated resources.
 * **Access policy**: Administrator only.
 */
export const endpointDelete = <ThrowOnError extends boolean = true>(
  options: Options<EndpointDeleteData, ThrowOnError>
): RequestResult<EndpointDeleteResponses, EndpointDeleteErrors, ThrowOnError> =>
  (options.client ?? client).delete<
    EndpointDeleteResponses,
    EndpointDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEndpointDeletePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zEndpointDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}',
    ...options,
  });

/**
 * Inspect an environment(endpoint)
 *
 * Retrieve details about an environment(endpoint).
 * **Access policy**: restricted
 */
export const endpointInspect = <ThrowOnError extends boolean = true>(
  options: Options<EndpointInspectData, ThrowOnError>
): RequestResult<
  EndpointInspectResponses,
  EndpointInspectErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    EndpointInspectResponses,
    EndpointInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEndpointInspectPath,
          query: zEndpointInspectQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEndpointInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}',
    ...options,
  });

/**
 * Update an environment(endpoint)
 *
 * Update an environment(endpoint).
 * **Access policy**: authenticated
 */
export const endpointUpdate = <ThrowOnError extends boolean = true>(
  options: Options<EndpointUpdateData, ThrowOnError>
): RequestResult<EndpointUpdateResponses, EndpointUpdateErrors, ThrowOnError> =>
  (options.client ?? client).put<
    EndpointUpdateResponses,
    EndpointUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zEndpointUpdateBody,
          path: zEndpointUpdatePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEndpointUpdateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * De-association an edge environment(endpoint)
 *
 * De-association an edge environment(endpoint).
 * **Access policy**: administrator
 */
export const endpointAssociationDelete = <ThrowOnError extends boolean = true>(
  options: Options<EndpointAssociationDeleteData, ThrowOnError>
): RequestResult<
  EndpointAssociationDeleteResponses,
  EndpointAssociationDeleteErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    EndpointAssociationDeleteResponses,
    EndpointAssociationDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEndpointAssociationDeletePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zEndpointAssociationDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}/association',
    ...options,
  });

/**
 * Upload a file under a specific path on the file system of an environment (endpoint)
 *
 * Use this environment(endpoint) to upload TLS files.
 * **Access policy**: administrator
 */
export const postEndpointsByIdDockerV2BrowsePut = <
  ThrowOnError extends boolean = true,
>(
  options: Options<PostEndpointsByIdDockerV2BrowsePutData, ThrowOnError>
): RequestResult<
  PostEndpointsByIdDockerV2BrowsePutResponses,
  PostEndpointsByIdDockerV2BrowsePutErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    PostEndpointsByIdDockerV2BrowsePutResponses,
    PostEndpointsByIdDockerV2BrowsePutErrors,
    ThrowOnError
  >({
    ...formDataBodySerializer,
    requestValidator: async (data) =>
      await z
        .object({
          body: zPostEndpointsByIdDockerV2BrowsePutBody,
          path: zPostEndpointsByIdDockerV2BrowsePutPath,
          query: zPostEndpointsByIdDockerV2BrowsePutQuery.optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zPostEndpointsByIdDockerV2BrowsePutResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}/docker/v2/browse/put',
    ...options,
    headers: {
      'Content-Type': null,
      ...options.headers,
    },
  });

/**
 * fetch docker pull limits
 *
 * get docker pull limits for a docker hub registry in the environment
 * **Access policy**:
 */
export const endpointDockerhubStatus = <ThrowOnError extends boolean = true>(
  options: Options<EndpointDockerhubStatusData, ThrowOnError>
): RequestResult<
  EndpointDockerhubStatusResponses,
  EndpointDockerhubStatusErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    EndpointDockerhubStatusResponses,
    EndpointDockerhubStatusErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEndpointDockerhubStatusPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEndpointDockerhubStatusResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}/dockerhub/{registryId}',
    ...options,
  });

/**
 * force update a docker service
 *
 * force update a docker service
 * **Access policy**: authenticated
 */
export const endpointForceUpdateService = <ThrowOnError extends boolean = true>(
  options: Options<EndpointForceUpdateServiceData, ThrowOnError>
): RequestResult<
  EndpointForceUpdateServiceResponses,
  EndpointForceUpdateServiceErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    EndpointForceUpdateServiceResponses,
    EndpointForceUpdateServiceErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zEndpointForceUpdateServiceBody,
          path: zEndpointForceUpdateServicePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEndpointForceUpdateServiceResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}/forceupdateservice',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * List Helm Releases
 *
 * **Access policy**: authenticated
 */
export const helmList = <ThrowOnError extends boolean = true>(
  options: Options<HelmListData, ThrowOnError>
): RequestResult<HelmListResponses, HelmListErrors, ThrowOnError> =>
  (options.client ?? client).get<
    HelmListResponses,
    HelmListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zHelmListPath,
          query: zHelmListQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) => await zHelmListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}/kubernetes/helm',
    ...options,
  });

/**
 * Install Helm Chart
 *
 * **Access policy**: authenticated
 */
export const helmInstall = <ThrowOnError extends boolean = true>(
  options: Options<HelmInstallData, ThrowOnError>
): RequestResult<HelmInstallResponses, HelmInstallErrors, ThrowOnError> =>
  (options.client ?? client).post<
    HelmInstallResponses,
    HelmInstallErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zHelmInstallBody,
          path: zHelmInstallPath,
          query: zHelmInstallQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zHelmInstallResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}/kubernetes/helm',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Delete Helm Release
 *
 * **Access policy**: authenticated
 */
export const helmDelete = <ThrowOnError extends boolean = true>(
  options: Options<HelmDeleteData, ThrowOnError>
): RequestResult<HelmDeleteResponses, HelmDeleteErrors, ThrowOnError> =>
  (options.client ?? client).delete<
    HelmDeleteResponses,
    HelmDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zHelmDeletePath,
          query: zHelmDeleteQuery.optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zHelmDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}/kubernetes/helm/{release}',
    ...options,
  });

/**
 * Get a helm release
 *
 * Get details of a helm release by release name
 * **Access policy**: authenticated
 */
export const helmGet = <ThrowOnError extends boolean = true>(
  options: Options<HelmGetData, ThrowOnError>
): RequestResult<HelmGetResponses, HelmGetErrors, ThrowOnError> =>
  (options.client ?? client).get<HelmGetResponses, HelmGetErrors, ThrowOnError>(
    {
      requestValidator: async (data) =>
        await z
          .object({
            body: z.never().optional(),
            path: zHelmGetPath,
            query: zHelmGetQuery.optional(),
          })
          .parseAsync(data),
      responseType: 'json',
      responseValidator: async (data) =>
        await zHelmGetResponse.parseAsync(data),
      security: [
        { name: 'X-API-KEY', type: 'apiKey' },
        { name: 'Authorization', type: 'apiKey' },
      ],
      url: '/endpoints/{id}/kubernetes/helm/{release}',
      ...options,
    }
  );

/**
 * Get a historical list of releases
 *
 * Get a historical list of releases by release name
 * **Access policy**: authenticated
 */
export const helmGetHistory = <ThrowOnError extends boolean = true>(
  options: Options<HelmGetHistoryData, ThrowOnError>
): RequestResult<HelmGetHistoryResponses, HelmGetHistoryErrors, ThrowOnError> =>
  (options.client ?? client).get<
    HelmGetHistoryResponses,
    HelmGetHistoryErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zHelmGetHistoryPath,
          query: zHelmGetHistoryQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zHelmGetHistoryResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}/kubernetes/helm/{release}/history',
    ...options,
  });

/**
 * Rollback a helm release
 *
 * Rollback a helm release to a previous revision
 * **Access policy**: authenticated
 */
export const helmRollback = <ThrowOnError extends boolean = true>(
  options: Options<HelmRollbackData, ThrowOnError>
): RequestResult<HelmRollbackResponses, HelmRollbackErrors, ThrowOnError> =>
  (options.client ?? client).post<
    HelmRollbackResponses,
    HelmRollbackErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zHelmRollbackPath,
          query: zHelmRollbackQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zHelmRollbackResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}/kubernetes/helm/{release}/rollback',
    ...options,
  });

/**
 * List Registries on environment
 *
 * List all registries based on the current user authorizations in current environment.
 * **Access policy**: authenticated
 */
export const endpointRegistriesList = <ThrowOnError extends boolean = true>(
  options: Options<EndpointRegistriesListData, ThrowOnError>
): RequestResult<
  EndpointRegistriesListResponses,
  EndpointRegistriesListErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    EndpointRegistriesListResponses,
    EndpointRegistriesListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEndpointRegistriesListPath,
          query: zEndpointRegistriesListQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEndpointRegistriesListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}/registries',
    ...options,
  });

/**
 * update registry access for environment
 *
 * **Access policy**: authenticated
 */
export const endpointRegistryAccess = <ThrowOnError extends boolean = true>(
  options: Options<EndpointRegistryAccessData, ThrowOnError>
): RequestResult<
  EndpointRegistryAccessResponses,
  EndpointRegistryAccessErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    EndpointRegistryAccessResponses,
    EndpointRegistryAccessErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zEndpointRegistryAccessBody,
          path: zEndpointRegistryAccessPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zEndpointRegistryAccessResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}/registries/{registryId}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Update settings for an environment(endpoint)
 *
 * Update settings for an environment(endpoint).
 * **Access policy**: authenticated
 */
export const endpointSettingsUpdate = <ThrowOnError extends boolean = true>(
  options: Options<EndpointSettingsUpdateData, ThrowOnError>
): RequestResult<
  EndpointSettingsUpdateResponses,
  EndpointSettingsUpdateErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    EndpointSettingsUpdateResponses,
    EndpointSettingsUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zEndpointSettingsUpdateBody,
          path: zEndpointSettingsUpdatePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEndpointSettingsUpdateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}/settings',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Snapshots an environment(endpoint)
 *
 * Snapshots an environment(endpoint)
 * **Access policy**: administrator
 */
export const endpointSnapshot = <ThrowOnError extends boolean = true>(
  options: Options<EndpointSnapshotData, ThrowOnError>
): RequestResult<
  EndpointSnapshotResponses,
  EndpointSnapshotErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    EndpointSnapshotResponses,
    EndpointSnapshotErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zEndpointSnapshotPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zEndpointSnapshotResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/{id}/snapshot',
    ...options,
  });

/**
 * Remove multiple environments
 *
 * Remove multiple environments and optionally clean-up associated resources.
 * **Access policy**: Administrator only.
 */
export const endpointDeleteBatch = <ThrowOnError extends boolean = true>(
  options: Options<EndpointDeleteBatchData, ThrowOnError>
): RequestResult<
  EndpointDeleteBatchResponses,
  EndpointDeleteBatchErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    EndpointDeleteBatchResponses,
    EndpointDeleteBatchErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zEndpointDeleteBatchBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEndpointDeleteBatchResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/delete',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Create or retrieve the endpoint for an EdgeID
 */
export const endpointCreateGlobalKey = <ThrowOnError extends boolean = true>(
  options?: Options<EndpointCreateGlobalKeyData, ThrowOnError>
): RequestResult<
  EndpointCreateGlobalKeyResponses,
  EndpointCreateGlobalKeyErrors,
  ThrowOnError
> =>
  (options?.client ?? client).post<
    EndpointCreateGlobalKeyResponses,
    EndpointCreateGlobalKeyErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zEndpointCreateGlobalKeyResponse.parseAsync(data),
    url: '/endpoints/global-key',
    ...options,
  });

/**
 * Update relations for a list of environments
 *
 * Update relations for a list of environments
 * Edge groups, tags and environment group can be updated.
 *
 * **Access policy**: administrator
 */
export const endpointUpdateRelations = <ThrowOnError extends boolean = true>(
  options: Options<EndpointUpdateRelationsData, ThrowOnError>
): RequestResult<
  EndpointUpdateRelationsResponses,
  EndpointUpdateRelationsErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    EndpointUpdateRelationsResponses,
    EndpointUpdateRelationsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zEndpointUpdateRelationsBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zEndpointUpdateRelationsResponse.parseAsync(data),
    security: [{ name: 'Authorization', type: 'apiKey' }],
    url: '/endpoints/relations',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Snapshot all environments(endpoints)
 *
 * Snapshot all environments(endpoints)
 * **Access policy**: administrator
 */
export const endpointSnapshots = <ThrowOnError extends boolean = true>(
  options?: Options<EndpointSnapshotsData, ThrowOnError>
): RequestResult<
  EndpointSnapshotsResponses,
  EndpointSnapshotsErrors,
  ThrowOnError
> =>
  (options?.client ?? client).post<
    EndpointSnapshotsResponses,
    EndpointSnapshotsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zEndpointSnapshotsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/snapshot',
    ...options,
  });

/**
 * Get environment summary counts
 *
 * Returns counts of environments by status (up, down) and ungrouped environments (unassigned), plus breakdowns by group, type, and health.
 * **Access policy**: restricted
 */
export const endpointSummaryCounts = <ThrowOnError extends boolean = true>(
  options?: Options<EndpointSummaryCountsData, ThrowOnError>
): RequestResult<
  EndpointSummaryCountsResponses,
  EndpointSummaryCountsErrors,
  ThrowOnError
> =>
  (options?.client ?? client).get<
    EndpointSummaryCountsResponses,
    EndpointSummaryCountsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zEndpointSummaryCountsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/endpoints/summary',
    ...options,
  });

/**
 * preview the content of target file in the git repository
 *
 * Retrieve the compose file content based on git repository configuration
 * **Access policy**: authenticated
 */
export const gitOperationRepoFilePreview = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GitOperationRepoFilePreviewData, ThrowOnError>
): RequestResult<
  GitOperationRepoFilePreviewResponses,
  GitOperationRepoFilePreviewErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    GitOperationRepoFilePreviewResponses,
    GitOperationRepoFilePreviewErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zGitOperationRepoFilePreviewBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGitOperationRepoFilePreviewResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/gitops/repo/file/preview',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * List all GitOps sources
 *
 * Returns a deduplicated list of git repositories used across all GitOps workflows.
 * **Access policy**: authenticated
 */
export const gitOpsSourcesList = <ThrowOnError extends boolean = true>(
  options?: Options<GitOpsSourcesListData, ThrowOnError>
): RequestResult<
  GitOpsSourcesListResponses,
  GitOpsSourcesListErrors,
  ThrowOnError
> =>
  (options?.client ?? client).get<
    GitOpsSourcesListResponses,
    GitOpsSourcesListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zGitOpsSourcesListQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGitOpsSourcesListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/gitops/sources',
    ...options,
  });

/**
 * Delete a source
 *
 * Deletes an existing GitOps source. Returns 409 if the source is referenced by any workflow or custom template.
 * **Access policy**: authenticated
 */
export const gitOpsSourcesDelete = <ThrowOnError extends boolean = true>(
  options: Options<GitOpsSourcesDeleteData, ThrowOnError>
): RequestResult<
  GitOpsSourcesDeleteResponses,
  GitOpsSourcesDeleteErrors,
  ThrowOnError
> =>
  (options.client ?? client).delete<
    GitOpsSourcesDeleteResponses,
    GitOpsSourcesDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGitOpsSourcesDeletePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zGitOpsSourcesDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/gitops/sources/{id}',
    ...options,
  });

/**
 * Get a GitOps source by ID
 *
 * Returns a single GitOps source with its connection settings and linked workflows.
 * **Access policy**: authenticated
 */
export const gitOpsSourceGet = <ThrowOnError extends boolean = true>(
  options: Options<GitOpsSourceGetData, ThrowOnError>
): RequestResult<
  GitOpsSourceGetResponses,
  GitOpsSourceGetErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GitOpsSourceGetResponses,
    GitOpsSourceGetErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGitOpsSourceGetPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGitOpsSourceGetResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/gitops/sources/{id}',
    ...options,
  });

/**
 * Update a Git source
 *
 * Updates an existing GitOps source backed by a Git repository.
 * **Access policy**: authenticated
 */
export const gitOpsSourcesUpdateGit = <ThrowOnError extends boolean = true>(
  options: Options<GitOpsSourcesUpdateGitData, ThrowOnError>
): RequestResult<
  GitOpsSourcesUpdateGitResponses,
  GitOpsSourcesUpdateGitErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    GitOpsSourcesUpdateGitResponses,
    GitOpsSourcesUpdateGitErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zGitOpsSourcesUpdateGitBody,
          path: zGitOpsSourcesUpdateGitPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGitOpsSourcesUpdateGitResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/gitops/sources/{id}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Update a GitOps source's access control
 *
 * Updates the access control settings for an existing GitOps source.
 * **Access policy**: administrator
 */
export const gitOpsSourcesUpdateAccess = <ThrowOnError extends boolean = true>(
  options: Options<GitOpsSourcesUpdateAccessData, ThrowOnError>
): RequestResult<
  GitOpsSourcesUpdateAccessResponses,
  GitOpsSourcesUpdateAccessErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    GitOpsSourcesUpdateAccessResponses,
    GitOpsSourcesUpdateAccessErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zGitOpsSourcesUpdateAccessBody,
          path: zGitOpsSourcesUpdateAccessPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGitOpsSourcesUpdateAccessResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/gitops/sources/{id}/access',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Test the connection of a stored source
 *
 * Tests connectivity for a GitOps source, applying optional overrides to the stored configuration.
 * **Access policy**: authenticated
 */
export const gitOpsSourcesTestById = <ThrowOnError extends boolean = true>(
  options: Options<GitOpsSourcesTestByIdData, ThrowOnError>
): RequestResult<
  GitOpsSourcesTestByIdResponses,
  GitOpsSourcesTestByIdErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    GitOpsSourcesTestByIdResponses,
    GitOpsSourcesTestByIdErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zGitOpsSourcesTestByIdBody.optional(),
          path: zGitOpsSourcesTestByIdPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGitOpsSourcesTestByIdResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/gitops/sources/{id}/test',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Create a Git source
 *
 * Creates a new GitOps source backed by a Git repository.
 * **Access policy**: authenticated
 */
export const gitOpsSourcesCreateGit = <ThrowOnError extends boolean = true>(
  options: Options<GitOpsSourcesCreateGitData, ThrowOnError>
): RequestResult<
  GitOpsSourcesCreateGitResponses,
  GitOpsSourcesCreateGitErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    GitOpsSourcesCreateGitResponses,
    GitOpsSourcesCreateGitErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zGitOpsSourcesCreateGitBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGitOpsSourcesCreateGitResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/gitops/sources/git',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Summarize GitOps source status counts
 *
 * Returns a count of sources per status.
 * **Access policy**: authenticated
 */
export const gitOpsSourcesSummary = <ThrowOnError extends boolean = true>(
  options?: Options<GitOpsSourcesSummaryData, ThrowOnError>
): RequestResult<
  GitOpsSourcesSummaryResponses,
  GitOpsSourcesSummaryErrors,
  ThrowOnError
> =>
  (options?.client ?? client).get<
    GitOpsSourcesSummaryResponses,
    GitOpsSourcesSummaryErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGitOpsSourcesSummaryResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/gitops/sources/summary',
    ...options,
  });

/**
 * Test a Git source connection
 *
 * Tests connectivity for Git connection details that have not been persisted yet.
 * **Access policy**: authenticated
 */
export const gitOpsSourcesTest = <ThrowOnError extends boolean = true>(
  options: Options<GitOpsSourcesTestData, ThrowOnError>
): RequestResult<
  GitOpsSourcesTestResponses,
  GitOpsSourcesTestErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    GitOpsSourcesTestResponses,
    GitOpsSourcesTestErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zGitOpsSourcesTestBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGitOpsSourcesTestResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/gitops/sources/test',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * List all GitOps workflows
 *
 * Returns a list of GitOps workflows, each with its aggregated status and the artifacts it contains.
 * **Access policy**: authenticated
 */
export const gitOpsWorkflowsList = <ThrowOnError extends boolean = true>(
  options?: Options<GitOpsWorkflowsListData, ThrowOnError>
): RequestResult<
  GitOpsWorkflowsListResponses,
  GitOpsWorkflowsListErrors,
  ThrowOnError
> =>
  (options?.client ?? client).get<
    GitOpsWorkflowsListResponses,
    GitOpsWorkflowsListErrors,
    ThrowOnError
  >({
    querySerializer: {
      parameters: { endpointIds: { array: { explode: false } } },
    },
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zGitOpsWorkflowsListQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGitOpsWorkflowsListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/gitops/workflows',
    ...options,
  });

/**
 * Get a GitOps workflow by ID
 *
 * Returns the detail view of a single GitOps workflow, with one entry per backing
 * stack or edge stack artifact.
 * **Access policy**: authenticated
 */
export const gitOpsWorkflowGet = <ThrowOnError extends boolean = true>(
  options: Options<GitOpsWorkflowGetData, ThrowOnError>
): RequestResult<
  GitOpsWorkflowGetResponses,
  GitOpsWorkflowGetErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GitOpsWorkflowGetResponses,
    GitOpsWorkflowGetErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGitOpsWorkflowGetPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGitOpsWorkflowGetResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/gitops/workflows/{id}',
    ...options,
  });

/**
 * Summarize GitOps workflow status counts
 *
 * Returns a count of workflows per status across all environments.
 * **Access policy**: authenticated
 */
export const gitOpsWorkflowsSummary = <ThrowOnError extends boolean = true>(
  options?: Options<GitOpsWorkflowsSummaryData, ThrowOnError>
): RequestResult<
  GitOpsWorkflowsSummaryResponses,
  GitOpsWorkflowsSummaryErrors,
  ThrowOnError
> =>
  (options?.client ?? client).get<
    GitOpsWorkflowsSummaryResponses,
    GitOpsWorkflowsSummaryErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGitOpsWorkflowsSummaryResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/gitops/workflows/summary',
    ...options,
  });

/**
 * Get a list of applications across all namespaces in the cluster. If the nodeName is provided, it will return the applications running on that node.
 *
 * Get a list of applications across all namespaces in the cluster. If the nodeName is provided, it will return the applications running on that node.
 * **Access policy**: authenticated
 */
export const getAllKubernetesApplications = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetAllKubernetesApplicationsData, ThrowOnError>
): RequestResult<
  GetAllKubernetesApplicationsResponses,
  GetAllKubernetesApplicationsErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesApplicationsResponses,
    GetAllKubernetesApplicationsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesApplicationsPath,
          query: zGetAllKubernetesApplicationsQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesApplicationsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/applications',
    ...options,
  });

/**
 * Get Applications count
 *
 * Get the count of Applications across all namespaces in the cluster. If the nodeName is provided, it will return the count of applications running on that node.
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesApplicationsCount = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetAllKubernetesApplicationsCountData, ThrowOnError>
): RequestResult<
  GetAllKubernetesApplicationsCountResponses,
  GetAllKubernetesApplicationsCountErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesApplicationsCountResponses,
    GetAllKubernetesApplicationsCountErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesApplicationsCountPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesApplicationsCountResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/applications/count',
    ...options,
  });

/**
 * Delete cluster role bindings
 *
 * Delete the provided list of cluster role bindings.
 * **Access policy**: Authenticated user.
 */
export const deleteClusterRoleBindings = <ThrowOnError extends boolean = true>(
  options: Options<DeleteClusterRoleBindingsData, ThrowOnError>
): RequestResult<
  DeleteClusterRoleBindingsResponses,
  DeleteClusterRoleBindingsErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    DeleteClusterRoleBindingsResponses,
    DeleteClusterRoleBindingsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zDeleteClusterRoleBindingsBody,
          path: zDeleteClusterRoleBindingsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zDeleteClusterRoleBindingsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/cluster_role_bindings/delete',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Delete cluster roles
 *
 * Delete the provided list of cluster roles.
 * **Access policy**: Authenticated user.
 */
export const deleteClusterRoles = <ThrowOnError extends boolean = true>(
  options: Options<DeleteClusterRolesData, ThrowOnError>
): RequestResult<
  DeleteClusterRolesResponses,
  DeleteClusterRolesErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    DeleteClusterRolesResponses,
    DeleteClusterRolesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zDeleteClusterRolesBody,
          path: zDeleteClusterRolesPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zDeleteClusterRolesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/cluster_roles/delete',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get a list of kubernetes cluster role bindings
 *
 * Get a list of kubernetes cluster role bindings within the given environment at the cluster level.
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesClusterRoleBindings = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetAllKubernetesClusterRoleBindingsData, ThrowOnError>
): RequestResult<
  GetAllKubernetesClusterRoleBindingsResponses,
  GetAllKubernetesClusterRoleBindingsErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesClusterRoleBindingsResponses,
    GetAllKubernetesClusterRoleBindingsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesClusterRoleBindingsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesClusterRoleBindingsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/clusterrolebindings',
    ...options,
  });

/**
 * Get a list of kubernetes cluster roles
 *
 * Get a list of kubernetes cluster roles within the given environment at the cluster level.
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesClusterRoles = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetAllKubernetesClusterRolesData, ThrowOnError>
): RequestResult<
  GetAllKubernetesClusterRolesResponses,
  GetAllKubernetesClusterRolesErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesClusterRolesResponses,
    GetAllKubernetesClusterRolesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesClusterRolesPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesClusterRolesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/clusterroles',
    ...options,
  });

/**
 * Get a list of ConfigMaps
 *
 * Get a list of ConfigMaps across all namespaces in the cluster. For non-admin users, it will only return ConfigMaps based on the namespaces that they have access to.
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesConfigMaps = <ThrowOnError extends boolean = true>(
  options: Options<GetAllKubernetesConfigMapsData, ThrowOnError>
): RequestResult<
  GetAllKubernetesConfigMapsResponses,
  GetAllKubernetesConfigMapsErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesConfigMapsResponses,
    GetAllKubernetesConfigMapsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesConfigMapsPath,
          query: zGetAllKubernetesConfigMapsQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesConfigMapsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/configmaps',
    ...options,
  });

/**
 * Get ConfigMaps count
 *
 * Get the count of ConfigMaps across all namespaces in the cluster. For non-admin users, it will only return the count of ConfigMaps based on the namespaces that they have access to.
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesConfigMapsCount = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetAllKubernetesConfigMapsCountData, ThrowOnError>
): RequestResult<
  GetAllKubernetesConfigMapsCountResponses,
  GetAllKubernetesConfigMapsCountErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesConfigMapsCountResponses,
    GetAllKubernetesConfigMapsCountErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesConfigMapsCountPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesConfigMapsCountResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/configmaps/count',
    ...options,
  });

/**
 * Get a list of kubernetes Cron Jobs
 *
 * Get a list of kubernetes Cron Jobs that the user has access to.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesCronJobs = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesCronJobsData, ThrowOnError>
): RequestResult<
  GetKubernetesCronJobsResponses,
  GetKubernetesCronJobsErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesCronJobsResponses,
    GetKubernetesCronJobsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesCronJobsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesCronJobsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/cron_jobs',
    ...options,
  });

/**
 * Delete Cron Jobs
 *
 * Delete the provided list of Cron Jobs.
 * **Access policy**: Authenticated user.
 */
export const deleteCronJobs = <ThrowOnError extends boolean = true>(
  options: Options<DeleteCronJobsData, ThrowOnError>
): RequestResult<DeleteCronJobsResponses, DeleteCronJobsErrors, ThrowOnError> =>
  (options.client ?? client).post<
    DeleteCronJobsResponses,
    DeleteCronJobsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zDeleteCronJobsBody,
          path: zDeleteCronJobsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zDeleteCronJobsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/cron_jobs/delete',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get the dashboard summary data
 *
 * Get the dashboard summary data which is simply a count of a range of different commonly used kubernetes resources.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesDashboard = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesDashboardData, ThrowOnError>
): RequestResult<
  GetKubernetesDashboardResponses,
  GetKubernetesDashboardErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesDashboardResponses,
    GetKubernetesDashboardErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesDashboardPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesDashboardResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/dashboard',
    ...options,
  });

/**
 * Get a description of a kubernetes resource
 *
 * Get a description of a kubernetes resource.
 * **Access policy**: Authenticated user.
 */
export const describeResource = <ThrowOnError extends boolean = true>(
  options: Options<DescribeResourceData, ThrowOnError>
): RequestResult<
  DescribeResourceResponses,
  DescribeResourceErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    DescribeResourceResponses,
    DescribeResourceErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zDescribeResourcePath,
          query: zDescribeResourceQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zDescribeResourceResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/describe',
    ...options,
  });

/**
 * Gets kubernetes events
 *
 * Get events by query param resourceId
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesEvents = <ThrowOnError extends boolean = true>(
  options: Options<GetAllKubernetesEventsData, ThrowOnError>
): RequestResult<
  GetAllKubernetesEventsResponses,
  GetAllKubernetesEventsErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesEventsResponses,
    GetAllKubernetesEventsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesEventsPath,
          query: zGetAllKubernetesEventsQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesEventsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/events',
    ...options,
  });

/**
 * Get a list of ingress controllers
 *
 * Get a list of ingress controllers for the given environment. If the allowedOnly query parameter is set, only ingress controllers that are allowed by the environment's ingress configuration will be returned.
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesIngressControllers = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetAllKubernetesIngressControllersData, ThrowOnError>
): RequestResult<
  GetAllKubernetesIngressControllersResponses,
  GetAllKubernetesIngressControllersErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesIngressControllersResponses,
    GetAllKubernetesIngressControllersErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesIngressControllersPath,
          query: zGetAllKubernetesIngressControllersQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesIngressControllersResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/ingresscontrollers',
    ...options,
  });

/**
 * Update (block/unblock) ingress controllers
 *
 * Update (block/unblock) ingress controllers for the provided environment.
 * **Access policy**: Authenticated user.
 */
export const updateKubernetesIngressControllers = <
  ThrowOnError extends boolean = true,
>(
  options: Options<UpdateKubernetesIngressControllersData, ThrowOnError>
): RequestResult<
  UpdateKubernetesIngressControllersResponses,
  UpdateKubernetesIngressControllersErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    UpdateKubernetesIngressControllersResponses,
    UpdateKubernetesIngressControllersErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zUpdateKubernetesIngressControllersBody,
          path: zUpdateKubernetesIngressControllersPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zUpdateKubernetesIngressControllersResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/ingresscontrollers',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get kubernetes ingresses at the cluster level
 *
 * Get kubernetes ingresses at the cluster level for the provided environment.
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesClusterIngresses = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetAllKubernetesClusterIngressesData, ThrowOnError>
): RequestResult<
  GetAllKubernetesClusterIngressesResponses,
  GetAllKubernetesClusterIngressesErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesClusterIngressesResponses,
    GetAllKubernetesClusterIngressesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesClusterIngressesPath,
          query: zGetAllKubernetesClusterIngressesQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesClusterIngressesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/ingresses',
    ...options,
  });

/**
 * Get Ingresses count
 *
 * Get the number of kubernetes ingresses within the given environment.
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesClusterIngressesCount = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetAllKubernetesClusterIngressesCountData, ThrowOnError>
): RequestResult<
  GetAllKubernetesClusterIngressesCountResponses,
  GetAllKubernetesClusterIngressesCountErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesClusterIngressesCountResponses,
    GetAllKubernetesClusterIngressesCountErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesClusterIngressesCountPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesClusterIngressesCountResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/ingresses/count',
    ...options,
  });

/**
 * Delete one or more Ingresses
 *
 * Delete one or more Ingresses in the provided environment.
 * **Access policy**: Authenticated user.
 */
export const deleteKubernetesIngresses = <ThrowOnError extends boolean = true>(
  options: Options<DeleteKubernetesIngressesData, ThrowOnError>
): RequestResult<
  DeleteKubernetesIngressesResponses,
  DeleteKubernetesIngressesErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    DeleteKubernetesIngressesResponses,
    DeleteKubernetesIngressesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zDeleteKubernetesIngressesBody,
          path: zDeleteKubernetesIngressesPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zDeleteKubernetesIngressesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/ingresses/delete',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get a list of kubernetes Jobs
 *
 * Get a list of kubernetes Jobs that the user has access to.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesJobs = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesJobsData, ThrowOnError>
): RequestResult<
  GetKubernetesJobsResponses,
  GetKubernetesJobsErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesJobsResponses,
    GetKubernetesJobsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesJobsPath,
          query: zGetKubernetesJobsQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesJobsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/jobs',
    ...options,
  });

/**
 * Delete Jobs
 *
 * Delete the provided list of Jobs.
 * **Access policy**: Authenticated user.
 */
export const deleteJobs = <ThrowOnError extends boolean = true>(
  options: Options<DeleteJobsData, ThrowOnError>
): RequestResult<DeleteJobsResponses, DeleteJobsErrors, ThrowOnError> =>
  (options.client ?? client).post<
    DeleteJobsResponses,
    DeleteJobsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zDeleteJobsBody,
          path: zDeleteJobsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zDeleteJobsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/jobs/delete',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get max CPU and memory limits of all nodes within k8s cluster
 *
 * Get max CPU and memory limits (unused resources) of all nodes within k8s cluster.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesMaxResourceLimits = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetKubernetesMaxResourceLimitsData, ThrowOnError>
): RequestResult<
  GetKubernetesMaxResourceLimitsResponses,
  GetKubernetesMaxResourceLimitsErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesMaxResourceLimitsResponses,
    GetKubernetesMaxResourceLimitsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesMaxResourceLimitsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesMaxResourceLimitsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/max_resource_limits',
    ...options,
  });

/**
 * Get the total resource requests and limits of all applications
 *
 * Get the total CPU (cores) and memory (bytes) requests and limits of all applications across all namespaces.
 * **Access policy**: Authenticated user.
 */
export const getApplicationsResources = <ThrowOnError extends boolean = true>(
  options: Options<GetApplicationsResourcesData, ThrowOnError>
): RequestResult<
  GetApplicationsResourcesResponses,
  GetApplicationsResourcesErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetApplicationsResourcesResponses,
    GetApplicationsResourcesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetApplicationsResourcesPath,
          query: zGetApplicationsResourcesQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetApplicationsResourcesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/metrics/applications_resources',
    ...options,
  });

/**
 * Get a list of nodes with their live metrics
 *
 * Get a list of metrics associated with all nodes of a cluster.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesMetricsForAllNodes = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetKubernetesMetricsForAllNodesData, ThrowOnError>
): RequestResult<
  GetKubernetesMetricsForAllNodesResponses,
  GetKubernetesMetricsForAllNodesErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesMetricsForAllNodesResponses,
    GetKubernetesMetricsForAllNodesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesMetricsForAllNodesPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesMetricsForAllNodesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/metrics/nodes',
    ...options,
  });

/**
 * Get live metrics for a node
 *
 * Get live metrics for the specified node.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesMetricsForNode = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetKubernetesMetricsForNodeData, ThrowOnError>
): RequestResult<
  GetKubernetesMetricsForNodeResponses,
  GetKubernetesMetricsForNodeErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesMetricsForNodeResponses,
    GetKubernetesMetricsForNodeErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesMetricsForNodePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesMetricsForNodeResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/metrics/nodes/{name}',
    ...options,
  });

/**
 * Get a list of pods with their live metrics
 *
 * Get a list of pods with their live metrics for the specified namespace.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesMetricsForAllPods = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetKubernetesMetricsForAllPodsData, ThrowOnError>
): RequestResult<
  GetKubernetesMetricsForAllPodsResponses,
  GetKubernetesMetricsForAllPodsErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesMetricsForAllPodsResponses,
    GetKubernetesMetricsForAllPodsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesMetricsForAllPodsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesMetricsForAllPodsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/metrics/pods/{namespace}',
    ...options,
  });

/**
 * Get live metrics for a pod
 *
 * Get live metrics for the specified pod.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesMetricsForPod = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesMetricsForPodData, ThrowOnError>
): RequestResult<
  GetKubernetesMetricsForPodResponses,
  GetKubernetesMetricsForPodErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesMetricsForPodResponses,
    GetKubernetesMetricsForPodErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesMetricsForPodPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesMetricsForPodResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/metrics/pods/{namespace}/{name}',
    ...options,
  });

/**
 * Delete a kubernetes namespace
 *
 * Delete a kubernetes namespace within the given environment.
 * **Access policy**: Authenticated user.
 */
export const deleteKubernetesNamespace = <ThrowOnError extends boolean = true>(
  options: Options<DeleteKubernetesNamespaceData, ThrowOnError>
): RequestResult<
  DeleteKubernetesNamespaceResponses,
  DeleteKubernetesNamespaceErrors,
  ThrowOnError
> =>
  (options.client ?? client).delete<
    DeleteKubernetesNamespaceResponses,
    DeleteKubernetesNamespaceErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zDeleteKubernetesNamespacePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zDeleteKubernetesNamespaceResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces',
    ...options,
  });

/**
 * Get a list of namespaces
 *
 * Get a list of all namespaces within the given environment based on the user role and permissions. If the user is an admin, they can access all namespaces. If the user is not an admin, they can only access namespaces that they have access to.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesNamespaces = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesNamespacesData, ThrowOnError>
): RequestResult<
  GetKubernetesNamespacesResponses,
  GetKubernetesNamespacesErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesNamespacesResponses,
    GetKubernetesNamespacesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesNamespacesPath,
          query: zGetKubernetesNamespacesQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesNamespacesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces',
    ...options,
  });

/**
 * Create a namespace
 *
 * Create a namespace within the given environment.
 * **Access policy**: Authenticated user.
 */
export const createKubernetesNamespace = <ThrowOnError extends boolean = true>(
  options: Options<CreateKubernetesNamespaceData, ThrowOnError>
): RequestResult<
  CreateKubernetesNamespaceResponses,
  CreateKubernetesNamespaceErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    CreateKubernetesNamespaceResponses,
    CreateKubernetesNamespaceErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zCreateKubernetesNamespaceBody,
          path: zCreateKubernetesNamespacePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zCreateKubernetesNamespaceResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Update a namespace
 *
 * Update a namespace within the given environment.
 * **Access policy**: Authenticated user.
 */
export const updateKubernetesNamespaceDeprecated = <
  ThrowOnError extends boolean = true,
>(
  options: Options<UpdateKubernetesNamespaceDeprecatedData, ThrowOnError>
): RequestResult<
  UpdateKubernetesNamespaceDeprecatedResponses,
  UpdateKubernetesNamespaceDeprecatedErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    UpdateKubernetesNamespaceDeprecatedResponses,
    UpdateKubernetesNamespaceDeprecatedErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zUpdateKubernetesNamespaceDeprecatedBody,
          path: zUpdateKubernetesNamespaceDeprecatedPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zUpdateKubernetesNamespaceDeprecatedResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get namespace details
 *
 * Get namespace details for the provided namespace within the given environment.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesNamespace = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesNamespaceData, ThrowOnError>
): RequestResult<
  GetKubernetesNamespaceResponses,
  GetKubernetesNamespaceErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesNamespaceResponses,
    GetKubernetesNamespaceErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesNamespacePath,
          query: zGetKubernetesNamespaceQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesNamespaceResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}',
    ...options,
  });

/**
 * Update a namespace
 *
 * Update a namespace within the given environment.
 * **Access policy**: Authenticated user.
 */
export const updateKubernetesNamespace = <ThrowOnError extends boolean = true>(
  options: Options<UpdateKubernetesNamespaceData, ThrowOnError>
): RequestResult<
  UpdateKubernetesNamespaceResponses,
  UpdateKubernetesNamespaceErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    UpdateKubernetesNamespaceResponses,
    UpdateKubernetesNamespaceErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zUpdateKubernetesNamespaceBody,
          path: zUpdateKubernetesNamespacePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zUpdateKubernetesNamespaceResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get a ConfigMap
 *
 * Get a ConfigMap by name for a given namespace.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesConfigMap = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesConfigMapData, ThrowOnError>
): RequestResult<
  GetKubernetesConfigMapResponses,
  GetKubernetesConfigMapErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesConfigMapResponses,
    GetKubernetesConfigMapErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesConfigMapPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesConfigMapResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/configmaps/{configmap}',
    ...options,
  });

/**
 * Gets kubernetes events for namespace
 *
 * Get events by optional query param resourceId for a given namespace.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesEventsForNamespace = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetKubernetesEventsForNamespaceData, ThrowOnError>
): RequestResult<
  GetKubernetesEventsForNamespaceResponses,
  GetKubernetesEventsForNamespaceErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesEventsForNamespaceResponses,
    GetKubernetesEventsForNamespaceErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesEventsForNamespacePath,
          query: zGetKubernetesEventsForNamespaceQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesEventsForNamespaceResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/events',
    ...options,
  });

/**
 * Get a list ingress controllers by namespace
 *
 * Get a list of ingress controllers for the given environment in the provided namespace.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesIngressControllersByNamespace = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetKubernetesIngressControllersByNamespaceData, ThrowOnError>
): RequestResult<
  GetKubernetesIngressControllersByNamespaceResponses,
  GetKubernetesIngressControllersByNamespaceErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesIngressControllersByNamespaceResponses,
    GetKubernetesIngressControllersByNamespaceErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesIngressControllersByNamespacePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesIngressControllersByNamespaceResponse.parseAsync(
        data
      ),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/ingresscontrollers',
    ...options,
  });

/**
 * Update (block/unblock) ingress controllers by namespace
 *
 * Update (block/unblock) ingress controllers by namespace for the provided environment.
 * **Access policy**: Authenticated user.
 */
export const updateKubernetesIngressControllersByNamespace = <
  ThrowOnError extends boolean = true,
>(
  options: Options<
    UpdateKubernetesIngressControllersByNamespaceData,
    ThrowOnError
  >
): RequestResult<
  UpdateKubernetesIngressControllersByNamespaceResponses,
  UpdateKubernetesIngressControllersByNamespaceErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    UpdateKubernetesIngressControllersByNamespaceResponses,
    UpdateKubernetesIngressControllersByNamespaceErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zUpdateKubernetesIngressControllersByNamespaceBody,
          path: zUpdateKubernetesIngressControllersByNamespacePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zUpdateKubernetesIngressControllersByNamespaceResponse.parseAsync(
        data
      ),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/ingresscontrollers',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get a list of Ingresses
 *
 * Get a list of Ingresses. If namespace is provided, it will return the list of Ingresses in that namespace.
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesIngresses = <ThrowOnError extends boolean = true>(
  options: Options<GetAllKubernetesIngressesData, ThrowOnError>
): RequestResult<
  GetAllKubernetesIngressesResponses,
  GetAllKubernetesIngressesErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesIngressesResponses,
    GetAllKubernetesIngressesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesIngressesPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesIngressesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/ingresses',
    ...options,
  });

/**
 * Create an Ingress
 *
 * Create an Ingress for the provided environment.
 * **Access policy**: Authenticated user.
 */
export const createKubernetesIngress = <ThrowOnError extends boolean = true>(
  options: Options<CreateKubernetesIngressData, ThrowOnError>
): RequestResult<
  CreateKubernetesIngressResponses,
  CreateKubernetesIngressErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    CreateKubernetesIngressResponses,
    CreateKubernetesIngressErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zCreateKubernetesIngressBody,
          path: zCreateKubernetesIngressPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zCreateKubernetesIngressResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/ingresses',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Update an Ingress
 *
 * Update an Ingress for the provided environment.
 * **Access policy**: Authenticated user.
 */
export const updateKubernetesIngress = <ThrowOnError extends boolean = true>(
  options: Options<UpdateKubernetesIngressData, ThrowOnError>
): RequestResult<
  UpdateKubernetesIngressResponses,
  UpdateKubernetesIngressErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    UpdateKubernetesIngressResponses,
    UpdateKubernetesIngressErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zUpdateKubernetesIngressBody,
          path: zUpdateKubernetesIngressPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zUpdateKubernetesIngressResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/ingresses',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get an Ingress by name
 *
 * Get an Ingress by name for the provided environment.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesIngress = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesIngressData, ThrowOnError>
): RequestResult<
  GetKubernetesIngressResponses,
  GetKubernetesIngressErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesIngressResponses,
    GetKubernetesIngressErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesIngressPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesIngressResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/ingresses/{ingress}',
    ...options,
  });

/**
 * Get PersistentVolumeClaims in a namespace
 *
 * Get a list of PersistentVolumeClaims in the specified namespace.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesPersistentVolumeClaimsInNamespace = <
  ThrowOnError extends boolean = true,
>(
  options: Options<
    GetKubernetesPersistentVolumeClaimsInNamespaceData,
    ThrowOnError
  >
): RequestResult<
  GetKubernetesPersistentVolumeClaimsInNamespaceResponses,
  GetKubernetesPersistentVolumeClaimsInNamespaceErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesPersistentVolumeClaimsInNamespaceResponses,
    GetKubernetesPersistentVolumeClaimsInNamespaceErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesPersistentVolumeClaimsInNamespacePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesPersistentVolumeClaimsInNamespaceResponse.parseAsync(
        data
      ),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/persistent_volume_claims',
    ...options,
  });

/**
 * Get a specific PersistentVolumeClaim
 *
 * Get a PersistentVolumeClaim by name within a namespace.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesPersistentVolumeClaim = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetKubernetesPersistentVolumeClaimData, ThrowOnError>
): RequestResult<
  GetKubernetesPersistentVolumeClaimResponses,
  GetKubernetesPersistentVolumeClaimErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesPersistentVolumeClaimResponses,
    GetKubernetesPersistentVolumeClaimErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesPersistentVolumeClaimPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesPersistentVolumeClaimResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/persistent_volume_claims/{name}',
    ...options,
  });

/**
 * Delete a kubernetes pod
 *
 * Delete a single Kubernetes pod in the given namespace. The owning
 * controller (Deployment, StatefulSet, DaemonSet, ...) is responsible
 * for recreating the pod. For naked pods the pod is removed permanently.
 * **Access policy**: Authenticated user.
 */
export const deleteKubernetesPod = <ThrowOnError extends boolean = true>(
  options: Options<DeleteKubernetesPodData, ThrowOnError>
): RequestResult<
  DeleteKubernetesPodResponses,
  DeleteKubernetesPodErrors,
  ThrowOnError
> =>
  (options.client ?? client).delete<
    DeleteKubernetesPodResponses,
    DeleteKubernetesPodErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zDeleteKubernetesPodPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zDeleteKubernetesPodResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/pods/{name}',
    ...options,
  });

/**
 * Restart all containers in a Kubernetes pod
 *
 * Restart all containers in a single Kubernetes pod in place using
 * the Kubernetes 1.35 alpha pod-restart subresource. The pod itself
 * is preserved. Requires the cluster to expose the corresponding
 * subresource (and the matching feature gate to be enabled).
 * **Access policy**: Authenticated user.
 */
export const restartKubernetesPod = <ThrowOnError extends boolean = true>(
  options: Options<RestartKubernetesPodData, ThrowOnError>
): RequestResult<
  RestartKubernetesPodResponses,
  RestartKubernetesPodErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    RestartKubernetesPodResponses,
    RestartKubernetesPodErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zRestartKubernetesPodPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zRestartKubernetesPodResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/pods/{name}/restart',
    ...options,
  });

/**
 * Get a Secret
 *
 * Get a Secret by name for a given namespace.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesSecret = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesSecretData, ThrowOnError>
): RequestResult<
  GetKubernetesSecretResponses,
  GetKubernetesSecretErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesSecretResponses,
    GetKubernetesSecretErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesSecretPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesSecretResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/secrets/{secret}',
    ...options,
  });

/**
 * Get a kubernetes service account
 *
 * Get a kubernetes service account in the given namespace.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesServiceAccount = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetKubernetesServiceAccountData, ThrowOnError>
): RequestResult<
  GetKubernetesServiceAccountResponses,
  GetKubernetesServiceAccountErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesServiceAccountResponses,
    GetKubernetesServiceAccountErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesServiceAccountPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesServiceAccountResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/service_accounts/{name}',
    ...options,
  });

/**
 * Update image pull secrets for a service account
 *
 * Replace the imagePullSecrets list on a service account with the provided list.
 * **Access policy**: Authenticated user.
 */
export const updateKubernetesServiceAccountImagePullSecrets = <
  ThrowOnError extends boolean = true,
>(
  options: Options<
    UpdateKubernetesServiceAccountImagePullSecretsData,
    ThrowOnError
  >
): RequestResult<
  UpdateKubernetesServiceAccountImagePullSecretsResponses,
  UpdateKubernetesServiceAccountImagePullSecretsErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    UpdateKubernetesServiceAccountImagePullSecretsResponses,
    UpdateKubernetesServiceAccountImagePullSecretsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zUpdateKubernetesServiceAccountImagePullSecretsBody,
          path: zUpdateKubernetesServiceAccountImagePullSecretsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zUpdateKubernetesServiceAccountImagePullSecretsResponse.parseAsync(
        data
      ),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/service_accounts/{name}/image_pull_secrets',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get a list of services for a given namespace
 *
 * Get a list of services for a given namespace.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesServicesByNamespace = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetKubernetesServicesByNamespaceData, ThrowOnError>
): RequestResult<
  GetKubernetesServicesByNamespaceResponses,
  GetKubernetesServicesByNamespaceErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesServicesByNamespaceResponses,
    GetKubernetesServicesByNamespaceErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesServicesByNamespacePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesServicesByNamespaceResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/services',
    ...options,
  });

/**
 * Create a service
 *
 * Create a service within a given namespace
 * **Access policy**: Authenticated user.
 */
export const createKubernetesService = <ThrowOnError extends boolean = true>(
  options: Options<CreateKubernetesServiceData, ThrowOnError>
): RequestResult<
  CreateKubernetesServiceResponses,
  CreateKubernetesServiceErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    CreateKubernetesServiceResponses,
    CreateKubernetesServiceErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zCreateKubernetesServiceBody,
          path: zCreateKubernetesServicePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zCreateKubernetesServiceResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/services',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Update a service
 *
 * Update a service within a given namespace.
 * **Access policy**: Authenticated user.
 */
export const updateKubernetesService = <ThrowOnError extends boolean = true>(
  options: Options<UpdateKubernetesServiceData, ThrowOnError>
): RequestResult<
  UpdateKubernetesServiceResponses,
  UpdateKubernetesServiceErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    UpdateKubernetesServiceResponses,
    UpdateKubernetesServiceErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zUpdateKubernetesServiceBody,
          path: zUpdateKubernetesServicePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zUpdateKubernetesServiceResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/services',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Toggle the system state for a namespace
 *
 * Toggle the system state for a namespace
 * **Access policy**: Administrator or environment administrator.
 */
export const kubernetesNamespacesToggleSystem = <
  ThrowOnError extends boolean = true,
>(
  options: Options<KubernetesNamespacesToggleSystemData, ThrowOnError>
): RequestResult<
  KubernetesNamespacesToggleSystemResponses,
  KubernetesNamespacesToggleSystemErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    KubernetesNamespacesToggleSystemResponses,
    KubernetesNamespacesToggleSystemErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zKubernetesNamespacesToggleSystemBody,
          path: zKubernetesNamespacesToggleSystemPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zKubernetesNamespacesToggleSystemResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/system',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get Kubernetes volumes within a namespace in the given Portainer environment
 *
 * Get a list of kubernetes volumes within the specified namespace in the given environment (Endpoint). The Endpoint ID must be a valid Portainer environment identifier.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesVolumesInNamespace = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetKubernetesVolumesInNamespaceData, ThrowOnError>
): RequestResult<
  GetKubernetesVolumesInNamespaceResponses,
  GetKubernetesVolumesInNamespaceErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesVolumesInNamespaceResponses,
    GetKubernetesVolumesInNamespaceErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesVolumesInNamespacePath,
          query: zGetKubernetesVolumesInNamespaceQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesVolumesInNamespaceResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/{namespace}/volumes',
    ...options,
  });

/**
 * Get the total number of kubernetes namespaces within the given Portainer environment.
 *
 * Get the total number of kubernetes namespaces within the given environment, including the system namespaces. The total count depends on the user's role and permissions.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesNamespacesCount = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetKubernetesNamespacesCountData, ThrowOnError>
): RequestResult<
  GetKubernetesNamespacesCountResponses,
  GetKubernetesNamespacesCountErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesNamespacesCountResponses,
    GetKubernetesNamespacesCountErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesNamespacesCountPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesNamespacesCountResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/namespaces/count',
    ...options,
  });

/**
 * Get Kubernetes cluster nodes
 *
 * Returns the list of Kubernetes nodes for the selected environment.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesNodes = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesNodesData, ThrowOnError>
): RequestResult<
  GetKubernetesNodesResponses,
  GetKubernetesNodesErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesNodesResponses,
    GetKubernetesNodesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesNodesPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesNodesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/nodes',
    ...options,
  });

/**
 * Drain a Kubernetes node
 *
 * Drain a Kubernetes node by safely evicting all pods from the node, preparing it for maintenance or removal
 * **Access policy**: authenticated
 */
export const drainNode = <ThrowOnError extends boolean = true>(
  options: Options<DrainNodeData, ThrowOnError>
): RequestResult<DrainNodeResponses, DrainNodeErrors, ThrowOnError> =>
  (options.client ?? client).post<
    DrainNodeResponses,
    DrainNodeErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zDrainNodePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zDrainNodeResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/nodes/{name}/drain',
    ...options,
  });

/**
 * Get CPU and memory limits of all nodes within k8s cluster
 *
 * Get CPU and memory limits of all nodes within k8s cluster.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesNodesLimits = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesNodesLimitsData, ThrowOnError>
): RequestResult<
  GetKubernetesNodesLimitsResponses,
  GetKubernetesNodesLimitsErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesNodesLimitsResponses,
    GetKubernetesNodesLimitsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesNodesLimitsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesNodesLimitsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/nodes_limits',
    ...options,
  });

/**
 * Get all PersistentVolumeClaims
 *
 * Get a list of all PersistentVolumeClaims within the given environment. Scoped by namespace for non-admin users.
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesPersistentVolumeClaims = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetAllKubernetesPersistentVolumeClaimsData, ThrowOnError>
): RequestResult<
  GetAllKubernetesPersistentVolumeClaimsResponses,
  GetAllKubernetesPersistentVolumeClaimsErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesPersistentVolumeClaimsResponses,
    GetAllKubernetesPersistentVolumeClaimsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesPersistentVolumeClaimsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesPersistentVolumeClaimsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/persistent_volume_claims',
    ...options,
  });

/**
 * Delete PersistentVolumeClaims
 *
 * Delete the provided list of PersistentVolumeClaims.
 * **Access policy**: Authenticated user.
 */
export const deleteKubernetesPersistentVolumeClaims = <
  ThrowOnError extends boolean = true,
>(
  options: Options<DeleteKubernetesPersistentVolumeClaimsData, ThrowOnError>
): RequestResult<
  DeleteKubernetesPersistentVolumeClaimsResponses,
  DeleteKubernetesPersistentVolumeClaimsErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    DeleteKubernetesPersistentVolumeClaimsResponses,
    DeleteKubernetesPersistentVolumeClaimsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zDeleteKubernetesPersistentVolumeClaimsBody,
          path: zDeleteKubernetesPersistentVolumeClaimsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zDeleteKubernetesPersistentVolumeClaimsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/persistent_volume_claims/delete',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Resize a PersistentVolumeClaim
 *
 * Resize a PVC to a new size. The StorageClass must support volume expansion.
 * **Access policy**: Authenticated user.
 */
export const resizeKubernetesPersistentVolumeClaim = <
  ThrowOnError extends boolean = true,
>(
  options: Options<ResizeKubernetesPersistentVolumeClaimData, ThrowOnError>
): RequestResult<
  ResizeKubernetesPersistentVolumeClaimResponses,
  ResizeKubernetesPersistentVolumeClaimErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    ResizeKubernetesPersistentVolumeClaimResponses,
    ResizeKubernetesPersistentVolumeClaimErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zResizeKubernetesPersistentVolumeClaimBody,
          path: zResizeKubernetesPersistentVolumeClaimPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zResizeKubernetesPersistentVolumeClaimResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/persistent_volume_claims/resize',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get all PersistentVolumes in the cluster
 *
 * Get a list of all PersistentVolumes in the given environment.
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesPersistentVolumes = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetAllKubernetesPersistentVolumesData, ThrowOnError>
): RequestResult<
  GetAllKubernetesPersistentVolumesResponses,
  GetAllKubernetesPersistentVolumesErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesPersistentVolumesResponses,
    GetAllKubernetesPersistentVolumesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesPersistentVolumesPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesPersistentVolumesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/persistent_volumes',
    ...options,
  });

/**
 * Get a specific PersistentVolume
 *
 * Get a PersistentVolume by name in the given environment.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesPersistentVolume = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetKubernetesPersistentVolumeData, ThrowOnError>
): RequestResult<
  GetKubernetesPersistentVolumeResponses,
  GetKubernetesPersistentVolumeErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesPersistentVolumeResponses,
    GetKubernetesPersistentVolumeErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesPersistentVolumePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesPersistentVolumeResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/persistent_volumes/{name}',
    ...options,
  });

/**
 * Delete PersistentVolumes
 *
 * Delete the provided list of PersistentVolumes.
 * **Access policy**: Authenticated user.
 */
export const deleteKubernetesPersistentVolumes = <
  ThrowOnError extends boolean = true,
>(
  options: Options<DeleteKubernetesPersistentVolumesData, ThrowOnError>
): RequestResult<
  DeleteKubernetesPersistentVolumesResponses,
  DeleteKubernetesPersistentVolumesErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    DeleteKubernetesPersistentVolumesResponses,
    DeleteKubernetesPersistentVolumesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zDeleteKubernetesPersistentVolumesBody,
          path: zDeleteKubernetesPersistentVolumesPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zDeleteKubernetesPersistentVolumesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/persistent_volumes/delete',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Update reclaim policy of a PersistentVolume
 *
 * Update the reclaim policy of a PersistentVolume.
 * **Access policy**: Authenticated user.
 */
export const updateKubernetesPersistentVolumeReclaimPolicy = <
  ThrowOnError extends boolean = true,
>(
  options: Options<
    UpdateKubernetesPersistentVolumeReclaimPolicyData,
    ThrowOnError
  >
): RequestResult<
  UpdateKubernetesPersistentVolumeReclaimPolicyResponses,
  UpdateKubernetesPersistentVolumeReclaimPolicyErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    UpdateKubernetesPersistentVolumeReclaimPolicyResponses,
    UpdateKubernetesPersistentVolumeReclaimPolicyErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zUpdateKubernetesPersistentVolumeReclaimPolicyBody,
          path: zUpdateKubernetesPersistentVolumeReclaimPolicyPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zUpdateKubernetesPersistentVolumeReclaimPolicyResponse.parseAsync(
        data
      ),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/persistent_volumes/reclaim_policy',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Check if RBAC is enabled
 *
 * Check if RBAC is enabled in the specified Kubernetes cluster.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesRbacStatus = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesRbacStatusData, ThrowOnError>
): RequestResult<
  GetKubernetesRbacStatusResponses,
  GetKubernetesRbacStatusErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesRbacStatusResponses,
    GetKubernetesRbacStatusErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesRbacStatusPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesRbacStatusResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/rbac_enabled',
    ...options,
  });

/**
 * Delete role bindings
 *
 * Delete the provided list of role bindings.
 * **Access policy**: Authenticated user.
 */
export const deleteRoleBindings = <ThrowOnError extends boolean = true>(
  options: Options<DeleteRoleBindingsData, ThrowOnError>
): RequestResult<
  DeleteRoleBindingsResponses,
  DeleteRoleBindingsErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    DeleteRoleBindingsResponses,
    DeleteRoleBindingsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zDeleteRoleBindingsBody,
          path: zDeleteRoleBindingsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zDeleteRoleBindingsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/role_bindings/delete',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get a list of kubernetes role bindings
 *
 * Get a list of kubernetes role bindings that the user has access to.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesRoleBindings = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesRoleBindingsData, ThrowOnError>
): RequestResult<
  GetKubernetesRoleBindingsResponses,
  GetKubernetesRoleBindingsErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesRoleBindingsResponses,
    GetKubernetesRoleBindingsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesRoleBindingsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesRoleBindingsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/rolebindings',
    ...options,
  });

/**
 * Get a list of kubernetes roles
 *
 * Get a list of kubernetes roles that the user has access to.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesRoles = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesRolesData, ThrowOnError>
): RequestResult<
  GetKubernetesRolesResponses,
  GetKubernetesRolesErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesRolesResponses,
    GetKubernetesRolesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesRolesPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesRolesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/roles',
    ...options,
  });

/**
 * Delete roles
 *
 * Delete the provided list of roles.
 * **Access policy**: Authenticated user.
 */
export const deleteRoles = <ThrowOnError extends boolean = true>(
  options: Options<DeleteRolesData, ThrowOnError>
): RequestResult<DeleteRolesResponses, DeleteRolesErrors, ThrowOnError> =>
  (options.client ?? client).post<
    DeleteRolesResponses,
    DeleteRolesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zDeleteRolesBody,
          path: zDeleteRolesPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zDeleteRolesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/roles/delete',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get a list of Secrets
 *
 * Get a list of Secrets for a given namespace. If isUsed is set to true, information about the applications that use the secrets is also returned.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesSecrets = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesSecretsData, ThrowOnError>
): RequestResult<
  GetKubernetesSecretsResponses,
  GetKubernetesSecretsErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesSecretsResponses,
    GetKubernetesSecretsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesSecretsPath,
          query: zGetKubernetesSecretsQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesSecretsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/secrets',
    ...options,
  });

/**
 * Get Secrets count
 *
 * Get the count of Secrets across all namespaces that the user has access to.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesSecretsCount = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesSecretsCountData, ThrowOnError>
): RequestResult<
  GetKubernetesSecretsCountResponses,
  GetKubernetesSecretsCountErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesSecretsCountResponses,
    GetKubernetesSecretsCountErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesSecretsCountPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesSecretsCountResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/secrets/count',
    ...options,
  });

/**
 * Delete service accounts
 *
 * Delete the provided list of service accounts.
 * **Access policy**: Authenticated user.
 */
export const deleteServiceAccounts = <ThrowOnError extends boolean = true>(
  options: Options<DeleteServiceAccountsData, ThrowOnError>
): RequestResult<
  DeleteServiceAccountsResponses,
  DeleteServiceAccountsErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    DeleteServiceAccountsResponses,
    DeleteServiceAccountsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zDeleteServiceAccountsBody,
          path: zDeleteServiceAccountsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zDeleteServiceAccountsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/service_accounts/delete',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get a list of kubernetes service accounts
 *
 * Get a list of kubernetes service accounts that the user has access to.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesServiceAccounts = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetKubernetesServiceAccountsData, ThrowOnError>
): RequestResult<
  GetKubernetesServiceAccountsResponses,
  GetKubernetesServiceAccountsErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesServiceAccountsResponses,
    GetKubernetesServiceAccountsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesServiceAccountsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesServiceAccountsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/serviceaccounts',
    ...options,
  });

/**
 * Get a list of services
 *
 * Get a list of services that the user has access to.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesServices = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesServicesData, ThrowOnError>
): RequestResult<
  GetKubernetesServicesResponses,
  GetKubernetesServicesErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesServicesResponses,
    GetKubernetesServicesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesServicesPath,
          query: zGetKubernetesServicesQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesServicesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/services',
    ...options,
  });

/**
 * Get services count
 *
 * Get the count of services that the user has access to.
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesServicesCount = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetAllKubernetesServicesCountData, ThrowOnError>
): RequestResult<
  GetAllKubernetesServicesCountResponses,
  GetAllKubernetesServicesCountErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesServicesCountResponses,
    GetAllKubernetesServicesCountErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesServicesCountPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesServicesCountResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/services/count',
    ...options,
  });

/**
 * Delete services
 *
 * Delete the provided list of services.
 * **Access policy**: Authenticated user.
 */
export const deleteKubernetesServices = <ThrowOnError extends boolean = true>(
  options: Options<DeleteKubernetesServicesData, ThrowOnError>
): RequestResult<
  DeleteKubernetesServicesResponses,
  DeleteKubernetesServicesErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    DeleteKubernetesServicesResponses,
    DeleteKubernetesServicesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zDeleteKubernetesServicesBody,
          path: zDeleteKubernetesServicesPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zDeleteKubernetesServicesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/services/delete',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get all StorageClasses
 *
 * Get a list of all StorageClasses in the given environment.
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesStorageClasses = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetAllKubernetesStorageClassesData, ThrowOnError>
): RequestResult<
  GetAllKubernetesStorageClassesResponses,
  GetAllKubernetesStorageClassesErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesStorageClassesResponses,
    GetAllKubernetesStorageClassesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesStorageClassesPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesStorageClassesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/storage_classes',
    ...options,
  });

/**
 * Get a specific StorageClass
 *
 * Get a StorageClass by name in the given environment.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesStorageClass = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesStorageClassData, ThrowOnError>
): RequestResult<
  GetKubernetesStorageClassResponses,
  GetKubernetesStorageClassErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesStorageClassResponses,
    GetKubernetesStorageClassErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesStorageClassPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesStorageClassResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/storage_classes/{name}',
    ...options,
  });

/**
 * Set a StorageClass as default
 *
 * Set the specified StorageClass as the cluster default, removing default from any other.
 * **Access policy**: Authenticated user.
 */
export const setDefaultKubernetesStorageClass = <
  ThrowOnError extends boolean = true,
>(
  options: Options<SetDefaultKubernetesStorageClassData, ThrowOnError>
): RequestResult<
  SetDefaultKubernetesStorageClassResponses,
  SetDefaultKubernetesStorageClassErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    SetDefaultKubernetesStorageClassResponses,
    SetDefaultKubernetesStorageClassErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zSetDefaultKubernetesStorageClassPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zSetDefaultKubernetesStorageClassResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/storage_classes/{name}/default',
    ...options,
  });

/**
 * Delete StorageClasses
 *
 * Delete the provided list of StorageClasses.
 * **Access policy**: Authenticated user.
 */
export const deleteKubernetesStorageClasses = <
  ThrowOnError extends boolean = true,
>(
  options: Options<DeleteKubernetesStorageClassesData, ThrowOnError>
): RequestResult<
  DeleteKubernetesStorageClassesResponses,
  DeleteKubernetesStorageClassesErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    DeleteKubernetesStorageClassesResponses,
    DeleteKubernetesStorageClassesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zDeleteKubernetesStorageClassesBody,
          path: zDeleteKubernetesStorageClassesPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zDeleteKubernetesStorageClassesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/storage_classes/delete',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get the Kubernetes cluster version and Portainer-relevant capabilities
 *
 * Get the Kubernetes cluster version (major, minor, gitVersion, ...)
 * as reported by the cluster's discovery API, augmented with capability
 * flags Portainer uses to gate UI features (e.g. supportsPodRestart).
 * **Access policy**: Authenticated user.
 */
export const getKubernetesVersion = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesVersionData, ThrowOnError>
): RequestResult<
  GetKubernetesVersionResponses,
  GetKubernetesVersionErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesVersionResponses,
    GetKubernetesVersionErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesVersionPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesVersionResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/version',
    ...options,
  });

/**
 * Get Kubernetes volumes within the given Portainer environment
 *
 * Get a list of all kubernetes volumes within the given environment (Endpoint). The Endpoint ID must be a valid Portainer environment identifier.
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesVolumes = <ThrowOnError extends boolean = true>(
  options: Options<GetAllKubernetesVolumesData, ThrowOnError>
): RequestResult<
  GetAllKubernetesVolumesResponses,
  GetAllKubernetesVolumesErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesVolumesResponses,
    GetAllKubernetesVolumesErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesVolumesPath,
          query: zGetAllKubernetesVolumesQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesVolumesResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/volumes',
    ...options,
  });

/**
 * Get a Kubernetes volume within the given Portainer environment
 *
 * Get a Kubernetes volume within the given environment (Endpoint). The Endpoint ID must be a valid Portainer environment identifier.
 * **Access policy**: Authenticated user.
 */
export const getKubernetesVolume = <ThrowOnError extends boolean = true>(
  options: Options<GetKubernetesVolumeData, ThrowOnError>
): RequestResult<
  GetKubernetesVolumeResponses,
  GetKubernetesVolumeErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetKubernetesVolumeResponses,
    GetKubernetesVolumeErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetKubernetesVolumePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetKubernetesVolumeResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/volumes/{namespace}/{volume}',
    ...options,
  });

/**
 * Get the total number of kubernetes volumes within the given Portainer environment.
 *
 * Get the total number of kubernetes volumes within the given environment (Endpoint). The total count depends on the user's role and permissions. The Endpoint ID must be a valid Portainer environment identifier.
 * **Access policy**: Authenticated user.
 */
export const getAllKubernetesVolumesCount = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetAllKubernetesVolumesCountData, ThrowOnError>
): RequestResult<
  GetAllKubernetesVolumesCountResponses,
  GetAllKubernetesVolumesCountErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetAllKubernetesVolumesCountResponses,
    GetAllKubernetesVolumesCountErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zGetAllKubernetesVolumesCountPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetAllKubernetesVolumesCountResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/{id}/volumes/count',
    ...options,
  });

/**
 * Generate a kubeconfig file
 *
 * Generate a kubeconfig file that allows a client to communicate with the Kubernetes API server
 * **Access policy**: Authenticated user.
 */
export const getKubernetesConfig = <ThrowOnError extends boolean = true>(
  options?: Options<GetKubernetesConfigData, ThrowOnError>
): RequestResult<
  GetKubernetesConfigResponses,
  GetKubernetesConfigErrors,
  ThrowOnError
> =>
  (options?.client ?? client).get<
    GetKubernetesConfigResponses,
    GetKubernetesConfigErrors,
    ThrowOnError
  >({
    querySerializer: {
      parameters: {
        ids: { array: { explode: false } },
        excludeIds: { array: { explode: false } },
      },
    },
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zGetKubernetesConfigQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/kubernetes/config',
    ...options,
  });

/**
 * Test LDAP connectivity
 *
 * Test LDAP connectivity using LDAP details
 * **Access policy**: administrator
 */
export const ldapCheck = <ThrowOnError extends boolean = true>(
  options: Options<LdapCheckData, ThrowOnError>
): RequestResult<LdapCheckResponses, LdapCheckErrors, ThrowOnError> =>
  (options.client ?? client).post<
    LdapCheckResponses,
    LdapCheckErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zLdapCheckBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zLdapCheckResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/ldap/check',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * fetches the message of the day
 *
 * **Access policy**: restricted
 */
export const motd = <ThrowOnError extends boolean = true>(
  options?: Options<MotdData, ThrowOnError>
): RequestResult<MotdResponses, unknown, ThrowOnError> =>
  (options?.client ?? client).get<MotdResponses, unknown, ThrowOnError>({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) => await zMotdResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/motd',
    ...options,
  });

/**
 * List Registries
 *
 * List all registries based on the current user authorizations.
 * Will return all registries if using an administrator account otherwise it
 * will only return authorized registries.
 * **Access policy**: restricted
 */
export const registryList = <ThrowOnError extends boolean = true>(
  options?: Options<RegistryListData, ThrowOnError>
): RequestResult<RegistryListResponses, RegistryListErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    RegistryListResponses,
    RegistryListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zRegistryListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/registries',
    ...options,
  });

/**
 * Create a new registry
 *
 * Create a new registry.
 * **Access policy**: restricted
 */
export const registryCreate = <ThrowOnError extends boolean = true>(
  options: Options<RegistryCreateData, ThrowOnError>
): RequestResult<RegistryCreateResponses, RegistryCreateErrors, ThrowOnError> =>
  (options.client ?? client).post<
    RegistryCreateResponses,
    RegistryCreateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zRegistryCreateBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zRegistryCreateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/registries',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Remove a registry
 *
 * Remove a registry
 * **Access policy**: restricted
 */
export const registryDelete = <ThrowOnError extends boolean = true>(
  options: Options<RegistryDeleteData, ThrowOnError>
): RequestResult<RegistryDeleteResponses, RegistryDeleteErrors, ThrowOnError> =>
  (options.client ?? client).delete<
    RegistryDeleteResponses,
    RegistryDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zRegistryDeletePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zRegistryDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/registries/{id}',
    ...options,
  });

/**
 * Inspect a registry
 *
 * Retrieve details about a registry.
 * **Access policy**: restricted
 */
export const registryInspect = <ThrowOnError extends boolean = true>(
  options: Options<RegistryInspectData, ThrowOnError>
): RequestResult<
  RegistryInspectResponses,
  RegistryInspectErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    RegistryInspectResponses,
    RegistryInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zRegistryInspectPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zRegistryInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/registries/{id}',
    ...options,
  });

/**
 * Update a registry
 *
 * Update a registry
 * **Access policy**: restricted
 */
export const registryUpdate = <ThrowOnError extends boolean = true>(
  options: Options<RegistryUpdateData, ThrowOnError>
): RequestResult<RegistryUpdateResponses, RegistryUpdateErrors, ThrowOnError> =>
  (options.client ?? client).put<
    RegistryUpdateResponses,
    RegistryUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zRegistryUpdateBody,
          path: zRegistryUpdatePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zRegistryUpdateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/registries/{id}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Configures a registry
 *
 * Configures a registry.
 * **Access policy**: restricted
 */
export const registryConfigure = <ThrowOnError extends boolean = true>(
  options: Options<RegistryConfigureData, ThrowOnError>
): RequestResult<
  RegistryConfigureResponses,
  RegistryConfigureErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    RegistryConfigureResponses,
    RegistryConfigureErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zRegistryConfigureBody,
          path: zRegistryConfigurePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zRegistryConfigureResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/registries/{id}/configure',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Test registry connection
 *
 * Test connection to a registry with provided credentials
 * **Access policy**: authenticated
 */
export const registryPing = <ThrowOnError extends boolean = true>(
  options: Options<RegistryPingData, ThrowOnError>
): RequestResult<RegistryPingResponses, RegistryPingErrors, ThrowOnError> =>
  (options.client ?? client).post<
    RegistryPingResponses,
    RegistryPingErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zRegistryPingBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zRegistryPingResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/registries/ping',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Create a new resource control
 *
 * Create a new resource control to restrict access to a Docker resource.
 * **Access policy**: administrator
 */
export const resourceControlCreate = <ThrowOnError extends boolean = true>(
  options: Options<ResourceControlCreateData, ThrowOnError>
): RequestResult<
  ResourceControlCreateResponses,
  ResourceControlCreateErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    ResourceControlCreateResponses,
    ResourceControlCreateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zResourceControlCreateBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zResourceControlCreateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/resource_controls',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Remove a resource control
 *
 * Remove a resource control.
 * **Access policy**: administrator
 */
export const resourceControlDelete = <ThrowOnError extends boolean = true>(
  options: Options<ResourceControlDeleteData, ThrowOnError>
): RequestResult<
  ResourceControlDeleteResponses,
  ResourceControlDeleteErrors,
  ThrowOnError
> =>
  (options.client ?? client).delete<
    ResourceControlDeleteResponses,
    ResourceControlDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zResourceControlDeletePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zResourceControlDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/resource_controls/{id}',
    ...options,
  });

/**
 * Update a resource control
 *
 * Update a resource control
 * **Access policy**: authenticated
 */
export const resourceControlUpdate = <ThrowOnError extends boolean = true>(
  options: Options<ResourceControlUpdateData, ThrowOnError>
): RequestResult<
  ResourceControlUpdateResponses,
  ResourceControlUpdateErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    ResourceControlUpdateResponses,
    ResourceControlUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zResourceControlUpdateBody,
          path: zResourceControlUpdatePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zResourceControlUpdateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/resource_controls/{id}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Triggers a system restore using provided backup file
 *
 * Triggers a system restore using provided backup file
 * **Access policy**: public (requires the X-Setup-Token header on an uninitialized instance unless --no-setup-token is set)
 */
export const restore = <ThrowOnError extends boolean = true>(
  options: Options<RestoreData, ThrowOnError>
): RequestResult<RestoreResponses, RestoreErrors, ThrowOnError> =>
  (options.client ?? client).post<
    RestoreResponses,
    RestoreErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zRestoreBody,
          headers: zRestoreHeaders.optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    url: '/restore',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * List roles
 *
 * List all roles available for use
 * **Access policy**: administrator
 */
export const roleList = <ThrowOnError extends boolean = true>(
  options?: Options<RoleListData, ThrowOnError>
): RequestResult<RoleListResponses, RoleListErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    RoleListResponses,
    RoleListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) => await zRoleListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/roles',
    ...options,
  });

/**
 * Retrieve Portainer settings
 *
 * Retrieve Portainer settings.
 * **Access policy**: administrator
 */
export const settingsInspect = <ThrowOnError extends boolean = true>(
  options?: Options<SettingsInspectData, ThrowOnError>
): RequestResult<
  SettingsInspectResponses,
  SettingsInspectErrors,
  ThrowOnError
> =>
  (options?.client ?? client).get<
    SettingsInspectResponses,
    SettingsInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zSettingsInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/settings',
    ...options,
  });

/**
 * Update Portainer settings
 *
 * Update Portainer settings.
 * **Access policy**: administrator
 */
export const settingsUpdate = <ThrowOnError extends boolean = true>(
  options: Options<SettingsUpdateData, ThrowOnError>
): RequestResult<SettingsUpdateResponses, SettingsUpdateErrors, ThrowOnError> =>
  (options.client ?? client).put<
    SettingsUpdateResponses,
    SettingsUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zSettingsUpdateBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zSettingsUpdateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/settings',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Retrieve Portainer public settings
 *
 * Retrieve public settings. Returns a small set of settings that are not reserved to administrators only.
 * **Access policy**: public
 */
export const settingsPublic = <ThrowOnError extends boolean = true>(
  options?: Options<SettingsPublicData, ThrowOnError>
): RequestResult<SettingsPublicResponses, SettingsPublicErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    SettingsPublicResponses,
    SettingsPublicErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zSettingsPublicResponse.parseAsync(data),
    url: '/settings/public',
    ...options,
  });

/**
 * Inspect the ssl settings
 *
 * Retrieve the ssl settings.
 * **Access policy**: administrator
 */
export const sslInspect = <ThrowOnError extends boolean = true>(
  options?: Options<SslInspectData, ThrowOnError>
): RequestResult<SslInspectResponses, SslInspectErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    SslInspectResponses,
    SslInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zSslInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/ssl',
    ...options,
  });

/**
 * Update the ssl settings
 *
 * Update the ssl settings.
 * **Access policy**: administrator
 */
export const sslUpdate = <ThrowOnError extends boolean = true>(
  options: Options<SslUpdateData, ThrowOnError>
): RequestResult<SslUpdateResponses, SslUpdateErrors, ThrowOnError> =>
  (options.client ?? client).put<
    SslUpdateResponses,
    SslUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zSslUpdateBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zSslUpdateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/ssl',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * List stacks
 *
 * List all stacks based on the current user authorizations.
 * Will return all stacks if using an administrator account otherwise it
 * will only return the list of stacks the user have access to.
 * Limited stacks will not be returned by this endpoint.
 * **Access policy**: authenticated
 */
export const stackList = <ThrowOnError extends boolean = true>(
  options?: Options<StackListData, ThrowOnError>
): RequestResult<StackListResponses, StackListErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    StackListResponses,
    StackListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zStackListQuery.optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zStackListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks',
    ...options,
  });

/**
 * Remove a stack
 *
 * Remove a stack.
 * **Access policy**: restricted
 */
export const stackDelete = <ThrowOnError extends boolean = true>(
  options: Options<StackDeleteData, ThrowOnError>
): RequestResult<StackDeleteResponses, StackDeleteErrors, ThrowOnError> =>
  (options.client ?? client).delete<
    StackDeleteResponses,
    StackDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zStackDeletePath,
          query: zStackDeleteQuery,
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zStackDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/{id}',
    ...options,
  });

/**
 * Inspect a stack
 *
 * Retrieve details about a stack.
 * **Access policy**: restricted
 */
export const stackInspect = <ThrowOnError extends boolean = true>(
  options: Options<StackInspectData, ThrowOnError>
): RequestResult<StackInspectResponses, StackInspectErrors, ThrowOnError> =>
  (options.client ?? client).get<
    StackInspectResponses,
    StackInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zStackInspectPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/{id}',
    ...options,
  });

/**
 * Update a stack
 *
 * Update a stack, only for file based stacks.
 * **Access policy**: authenticated
 */
export const stackUpdate = <ThrowOnError extends boolean = true>(
  options: Options<StackUpdateData, ThrowOnError>
): RequestResult<StackUpdateResponses, StackUpdateErrors, ThrowOnError> =>
  (options.client ?? client).put<
    StackUpdateResponses,
    StackUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zStackUpdateBody,
          path: zStackUpdatePath,
          query: zStackUpdateQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackUpdateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/{id}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Associate an orphaned stack to a new environment(endpoint)
 *
 * **Access policy**: administrator
 */
export const stackAssociate = <ThrowOnError extends boolean = true>(
  options: Options<StackAssociateData, ThrowOnError>
): RequestResult<StackAssociateResponses, StackAssociateErrors, ThrowOnError> =>
  (options.client ?? client).put<
    StackAssociateResponses,
    StackAssociateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zStackAssociatePath,
          query: zStackAssociateQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackAssociateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/{id}/associate',
    ...options,
  });

/**
 * Retrieve the content of the Stack file for the specified stack
 *
 * Get Stack file content.
 * **Access policy**: restricted
 */
export const stackFileInspect = <ThrowOnError extends boolean = true>(
  options: Options<StackFileInspectData, ThrowOnError>
): RequestResult<
  StackFileInspectResponses,
  StackFileInspectErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    StackFileInspectResponses,
    StackFileInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zStackFileInspectPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackFileInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/{id}/file',
    ...options,
  });

/**
 * Update a stack's Git configs
 *
 * Update the Git settings in a stack, e.g., RepositoryReferenceName and AutoUpdate. When SourceID is set, URL/auth/TLS are taken from the referenced Source.
 * **Access policy**: authenticated
 */
export const stackUpdateGit = <ThrowOnError extends boolean = true>(
  options: Options<StackUpdateGitData, ThrowOnError>
): RequestResult<StackUpdateGitResponses, StackUpdateGitErrors, ThrowOnError> =>
  (options.client ?? client).post<
    StackUpdateGitResponses,
    StackUpdateGitErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zStackUpdateGitBody,
          path: zStackUpdateGitPath,
          query: zStackUpdateGitQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackUpdateGitResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/{id}/git',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Redeploy a stack
 *
 * Pull and redeploy a stack via Git
 * **Access policy**: authenticated
 */
export const stackGitRedeploy = <ThrowOnError extends boolean = true>(
  options: Options<StackGitRedeployData, ThrowOnError>
): RequestResult<
  StackGitRedeployResponses,
  StackGitRedeployErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    StackGitRedeployResponses,
    StackGitRedeployErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zStackGitRedeployBody,
          path: zStackGitRedeployPath,
          query: zStackGitRedeployQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackGitRedeployResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/{id}/git/redeploy',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Migrate a stack to another environment(endpoint)
 *
 * Migrate a stack from an environment(endpoint) to another environment(endpoint). It will re-create the stack inside the target environment(endpoint) before removing the original stack.
 * **Access policy**: authenticated
 */
export const stackMigrate = <ThrowOnError extends boolean = true>(
  options: Options<StackMigrateData, ThrowOnError>
): RequestResult<StackMigrateResponses, StackMigrateErrors, ThrowOnError> =>
  (options.client ?? client).post<
    StackMigrateResponses,
    StackMigrateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zStackMigrateBody,
          path: zStackMigratePath,
          query: zStackMigrateQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackMigrateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/{id}/migrate',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Starts a stopped Stack
 *
 * Starts a stopped Stack.
 * **Access policy**: authenticated
 */
export const stackStart = <ThrowOnError extends boolean = true>(
  options: Options<StackStartData, ThrowOnError>
): RequestResult<StackStartResponses, StackStartErrors, ThrowOnError> =>
  (options.client ?? client).post<
    StackStartResponses,
    StackStartErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zStackStartPath,
          query: zStackStartQuery,
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zStackStartResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/{id}/start',
    ...options,
  });

/**
 * Stop a running Stack
 *
 * Stop a running Stack.
 * **Access policy**: authenticated
 */
export const stackStop = <ThrowOnError extends boolean = true>(
  options: Options<StackStopData, ThrowOnError>
): RequestResult<StackStopResponses, StackStopErrors, ThrowOnError> =>
  (options.client ?? client).post<
    StackStopResponses,
    StackStopErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zStackStopPath,
          query: zStackStopQuery,
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zStackStopResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/{id}/stop',
    ...options,
  });

/**
 * Deploy a new kubernetes stack from a git repository
 *
 * Deploy a new stack into a Docker environment specified via the environment identifier.
 * **Access policy**: authenticated
 */
export const stackCreateKubernetesGit = <ThrowOnError extends boolean = true>(
  options: Options<StackCreateKubernetesGitData, ThrowOnError>
): RequestResult<
  StackCreateKubernetesGitResponses,
  StackCreateKubernetesGitErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    StackCreateKubernetesGitResponses,
    StackCreateKubernetesGitErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zStackCreateKubernetesGitBody,
          path: z.never().optional(),
          query: zStackCreateKubernetesGitQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackCreateKubernetesGitResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/create/kubernetes/repository',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Deploy a new kubernetes stack from a file
 *
 * Deploy a new stack into a Docker environment specified via the environment identifier.
 * **Access policy**: authenticated
 */
export const stackCreateKubernetesFile = <ThrowOnError extends boolean = true>(
  options: Options<StackCreateKubernetesFileData, ThrowOnError>
): RequestResult<
  StackCreateKubernetesFileResponses,
  StackCreateKubernetesFileErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    StackCreateKubernetesFileResponses,
    StackCreateKubernetesFileErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zStackCreateKubernetesFileBody,
          path: z.never().optional(),
          query: zStackCreateKubernetesFileQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackCreateKubernetesFileResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/create/kubernetes/string',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Deploy a new kubernetes stack from a url
 *
 * Deploy a new stack into a Docker environment specified via the environment identifier.
 * **Access policy**: authenticated
 */
export const stackCreateKubernetesUrl = <ThrowOnError extends boolean = true>(
  options: Options<StackCreateKubernetesUrlData, ThrowOnError>
): RequestResult<
  StackCreateKubernetesUrlResponses,
  StackCreateKubernetesUrlErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    StackCreateKubernetesUrlResponses,
    StackCreateKubernetesUrlErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zStackCreateKubernetesUrlBody,
          path: z.never().optional(),
          query: zStackCreateKubernetesUrlQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackCreateKubernetesUrlResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/create/kubernetes/url',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Deploy a new compose stack from a file
 *
 * Deploy a new stack into a Docker environment specified via the environment identifier.
 * **Access policy**: authenticated
 */
export const stackCreateDockerStandaloneFile = <
  ThrowOnError extends boolean = true,
>(
  options: Options<StackCreateDockerStandaloneFileData, ThrowOnError>
): RequestResult<
  StackCreateDockerStandaloneFileResponses,
  StackCreateDockerStandaloneFileErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    StackCreateDockerStandaloneFileResponses,
    StackCreateDockerStandaloneFileErrors,
    ThrowOnError
  >({
    ...formDataBodySerializer,
    requestValidator: async (data) =>
      await z
        .object({
          body: zStackCreateDockerStandaloneFileBody,
          path: z.never().optional(),
          query: zStackCreateDockerStandaloneFileQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackCreateDockerStandaloneFileResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/create/standalone/file',
    ...options,
    headers: {
      'Content-Type': null,
      ...options.headers,
    },
  });

/**
 * Deploy a new compose stack from repository
 *
 * Deploy a new stack into a Docker environment specified via the environment identifier.
 * **Access policy**: authenticated
 */
export const stackCreateDockerStandaloneRepository = <
  ThrowOnError extends boolean = true,
>(
  options: Options<StackCreateDockerStandaloneRepositoryData, ThrowOnError>
): RequestResult<
  StackCreateDockerStandaloneRepositoryResponses,
  StackCreateDockerStandaloneRepositoryErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    StackCreateDockerStandaloneRepositoryResponses,
    StackCreateDockerStandaloneRepositoryErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zStackCreateDockerStandaloneRepositoryBody,
          path: z.never().optional(),
          query: zStackCreateDockerStandaloneRepositoryQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackCreateDockerStandaloneRepositoryResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/create/standalone/repository',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Deploy a new compose stack from a text
 *
 * Deploy a new stack into a Docker environment specified via the environment identifier.
 * **Access policy**: authenticated
 */
export const stackCreateDockerStandaloneString = <
  ThrowOnError extends boolean = true,
>(
  options: Options<StackCreateDockerStandaloneStringData, ThrowOnError>
): RequestResult<
  StackCreateDockerStandaloneStringResponses,
  StackCreateDockerStandaloneStringErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    StackCreateDockerStandaloneStringResponses,
    StackCreateDockerStandaloneStringErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zStackCreateDockerStandaloneStringBody,
          path: z.never().optional(),
          query: zStackCreateDockerStandaloneStringQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackCreateDockerStandaloneStringResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/create/standalone/string',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Deploy a new swarm stack from a file
 *
 * Deploy a new stack into a Docker environment specified via the environment identifier.
 * **Access policy**: authenticated
 */
export const stackCreateDockerSwarmFile = <ThrowOnError extends boolean = true>(
  options: Options<StackCreateDockerSwarmFileData, ThrowOnError>
): RequestResult<
  StackCreateDockerSwarmFileResponses,
  StackCreateDockerSwarmFileErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    StackCreateDockerSwarmFileResponses,
    StackCreateDockerSwarmFileErrors,
    ThrowOnError
  >({
    ...formDataBodySerializer,
    requestValidator: async (data) =>
      await z
        .object({
          body: zStackCreateDockerSwarmFileBody.optional(),
          path: z.never().optional(),
          query: zStackCreateDockerSwarmFileQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackCreateDockerSwarmFileResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/create/swarm/file',
    ...options,
    headers: {
      'Content-Type': null,
      ...options.headers,
    },
  });

/**
 * Deploy a new swarm stack from a git repository
 *
 * Deploy a new stack into a Docker environment specified via the environment identifier.
 * **Access policy**: authenticated
 */
export const stackCreateDockerSwarmRepository = <
  ThrowOnError extends boolean = true,
>(
  options: Options<StackCreateDockerSwarmRepositoryData, ThrowOnError>
): RequestResult<
  StackCreateDockerSwarmRepositoryResponses,
  StackCreateDockerSwarmRepositoryErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    StackCreateDockerSwarmRepositoryResponses,
    StackCreateDockerSwarmRepositoryErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zStackCreateDockerSwarmRepositoryBody,
          path: z.never().optional(),
          query: zStackCreateDockerSwarmRepositoryQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackCreateDockerSwarmRepositoryResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/create/swarm/repository',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Deploy a new swarm stack from a text
 *
 * Deploy a new stack into a Docker environment specified via the environment identifier.
 * **Access policy**: authenticated
 */
export const stackCreateDockerSwarmString = <
  ThrowOnError extends boolean = true,
>(
  options: Options<StackCreateDockerSwarmStringData, ThrowOnError>
): RequestResult<
  StackCreateDockerSwarmStringResponses,
  StackCreateDockerSwarmStringErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    StackCreateDockerSwarmStringResponses,
    StackCreateDockerSwarmStringErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zStackCreateDockerSwarmStringBody,
          path: z.never().optional(),
          query: zStackCreateDockerSwarmStringQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zStackCreateDockerSwarmStringResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/create/swarm/string',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Remove Kubernetes stacks by name
 *
 * Remove a stack.
 * **Access policy**: restricted
 */
export const stackDeleteKubernetesByName = <
  ThrowOnError extends boolean = true,
>(
  options: Options<StackDeleteKubernetesByNameData, ThrowOnError>
): RequestResult<
  StackDeleteKubernetesByNameResponses,
  StackDeleteKubernetesByNameErrors,
  ThrowOnError
> =>
  (options.client ?? client).delete<
    StackDeleteKubernetesByNameResponses,
    StackDeleteKubernetesByNameErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zStackDeleteKubernetesByNamePath,
          query: zStackDeleteKubernetesByNameQuery,
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zStackDeleteKubernetesByNameResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/stacks/name/{name}',
    ...options,
  });

/**
 * Webhook for triggering stack updates from git
 *
 * **Access policy**: public
 */
export const webhookInvoke = <ThrowOnError extends boolean = true>(
  options: Options<WebhookInvokeData, ThrowOnError>
): RequestResult<WebhookInvokeResponses, WebhookInvokeErrors, ThrowOnError> =>
  (options.client ?? client).post<
    WebhookInvokeResponses,
    WebhookInvokeErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zWebhookInvokePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    url: '/stacks/webhooks/{webhookID}',
    ...options,
  });

/**
 * Retrieve system info
 *
 * **Access policy**: authenticated
 */
export const systemInfo = <ThrowOnError extends boolean = true>(
  options?: Options<SystemInfoData, ThrowOnError>
): RequestResult<SystemInfoResponses, SystemInfoErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    SystemInfoResponses,
    SystemInfoErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zSystemInfoResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/system/info',
    ...options,
  });

/**
 * Retrieve the count of nodes
 *
 * **Access policy**: authenticated
 */
export const systemNodesCount = <ThrowOnError extends boolean = true>(
  options?: Options<SystemNodesCountData, ThrowOnError>
): RequestResult<
  SystemNodesCountResponses,
  SystemNodesCountErrors,
  ThrowOnError
> =>
  (options?.client ?? client).get<
    SystemNodesCountResponses,
    SystemNodesCountErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zSystemNodesCountResponse2.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/system/nodes',
    ...options,
  });

/**
 * Check Portainer status
 *
 * Retrieve Portainer status
 * **Access policy**: public
 */
export const systemStatus = <ThrowOnError extends boolean = true>(
  options?: Options<SystemStatusData, ThrowOnError>
): RequestResult<SystemStatusResponses, unknown, ThrowOnError> =>
  (options?.client ?? client).get<SystemStatusResponses, unknown, ThrowOnError>(
    {
      requestValidator: async (data) =>
        await z
          .object({
            body: z.never().optional(),
            path: z.never().optional(),
            query: z.never().optional(),
          })
          .parseAsync(data),
      responseType: 'json',
      responseValidator: async (data) =>
        await zSystemStatusResponse.parseAsync(data),
      url: '/system/status',
      ...options,
    }
  );

/**
 * Upgrade Portainer to BE
 *
 * Upgrade Portainer to BE
 * **Access policy**: administrator
 */
export const systemUpgrade = <ThrowOnError extends boolean = true>(
  options?: Options<SystemUpgradeData, ThrowOnError>
): RequestResult<SystemUpgradeResponses, unknown, ThrowOnError> =>
  (options?.client ?? client).post<
    SystemUpgradeResponses,
    unknown,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zSystemUpgradeResponse.parseAsync(data),
    url: '/system/upgrade',
    ...options,
  });

/**
 * Check for portainer updates
 *
 * Check if portainer has an update available
 * **Access policy**: authenticated
 */
export const systemVersion = <ThrowOnError extends boolean = true>(
  options?: Options<SystemVersionData, ThrowOnError>
): RequestResult<SystemVersionResponses, unknown, ThrowOnError> =>
  (options?.client ?? client).get<
    SystemVersionResponses,
    unknown,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zSystemVersionResponse2.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/system/version',
    ...options,
  });

/**
 * List tags
 *
 * List tags.
 * **Access policy**: authenticated
 */
export const tagList = <ThrowOnError extends boolean = true>(
  options?: Options<TagListData, ThrowOnError>
): RequestResult<TagListResponses, TagListErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    TagListResponses,
    TagListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) => await zTagListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/tags',
    ...options,
  });

/**
 * Create a new tag
 *
 * Create a new tag.
 * **Access policy**: administrator
 */
export const tagCreate = <ThrowOnError extends boolean = true>(
  options: Options<TagCreateData, ThrowOnError>
): RequestResult<TagCreateResponses, TagCreateErrors, ThrowOnError> =>
  (options.client ?? client).post<
    TagCreateResponses,
    TagCreateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zTagCreateBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zTagCreateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/tags',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Remove a tag
 *
 * Remove a tag.
 * **Access policy**: administrator
 */
export const tagDelete = <ThrowOnError extends boolean = true>(
  options: Options<TagDeleteData, ThrowOnError>
): RequestResult<TagDeleteResponses, TagDeleteErrors, ThrowOnError> =>
  (options.client ?? client).delete<
    TagDeleteResponses,
    TagDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zTagDeletePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zTagDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/tags/{id}',
    ...options,
  });

/**
 * List team memberships
 *
 * List team memberships. Access is only available to administrators and team leaders.
 * **Access policy**: administrator
 */
export const teamMembershipList = <ThrowOnError extends boolean = true>(
  options?: Options<TeamMembershipListData, ThrowOnError>
): RequestResult<
  TeamMembershipListResponses,
  TeamMembershipListErrors,
  ThrowOnError
> =>
  (options?.client ?? client).get<
    TeamMembershipListResponses,
    TeamMembershipListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zTeamMembershipListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/team_memberships',
    ...options,
  });

/**
 * Create a new team membership
 *
 * Create a new team memberships. Access is only available to administrators leaders of the associated team.
 * **Access policy**: administrator
 */
export const teamMembershipCreate = <ThrowOnError extends boolean = true>(
  options: Options<TeamMembershipCreateData, ThrowOnError>
): RequestResult<
  TeamMembershipCreateResponses,
  TeamMembershipCreateErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    TeamMembershipCreateResponses,
    TeamMembershipCreateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zTeamMembershipCreateBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zTeamMembershipCreateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/team_memberships',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Remove a team membership
 *
 * Remove a team membership. Access is only available to administrators leaders of the associated team.
 * **Access policy**: administrator
 */
export const teamMembershipDelete = <ThrowOnError extends boolean = true>(
  options: Options<TeamMembershipDeleteData, ThrowOnError>
): RequestResult<
  TeamMembershipDeleteResponses,
  TeamMembershipDeleteErrors,
  ThrowOnError
> =>
  (options.client ?? client).delete<
    TeamMembershipDeleteResponses,
    TeamMembershipDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zTeamMembershipDeletePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zTeamMembershipDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/team_memberships/{id}',
    ...options,
  });

/**
 * Update a team membership
 *
 * Update a team membership. Access is only available to administrators or leaders of the associated team.
 * **Access policy**: administrator or leaders of the associated team
 */
export const teamMembershipUpdate = <ThrowOnError extends boolean = true>(
  options: Options<TeamMembershipUpdateData, ThrowOnError>
): RequestResult<
  TeamMembershipUpdateResponses,
  TeamMembershipUpdateErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    TeamMembershipUpdateResponses,
    TeamMembershipUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zTeamMembershipUpdateBody,
          path: zTeamMembershipUpdatePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zTeamMembershipUpdateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/team_memberships/{id}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * List teams
 *
 * List teams. For non-administrator users, will only list the teams they are member of.
 * **Access policy**: restricted
 */
export const teamList = <ThrowOnError extends boolean = true>(
  options?: Options<TeamListData, ThrowOnError>
): RequestResult<TeamListResponses, TeamListErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    TeamListResponses,
    TeamListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zTeamListQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) => await zTeamListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/teams',
    ...options,
  });

/**
 * Create a new team
 *
 * Create a new team.
 * **Access policy**: administrator
 */
export const teamCreate = <ThrowOnError extends boolean = true>(
  options: Options<TeamCreateData, ThrowOnError>
): RequestResult<TeamCreateResponses, TeamCreateErrors, ThrowOnError> =>
  (options.client ?? client).post<
    TeamCreateResponses,
    TeamCreateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zTeamCreateBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zTeamCreateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/teams',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Remove a team
 *
 * Remove a team.
 * **Access policy**: administrator
 */
export const teamDelete = <ThrowOnError extends boolean = true>(
  options: Options<TeamDeleteData, ThrowOnError>
): RequestResult<TeamDeleteResponses, TeamDeleteErrors, ThrowOnError> =>
  (options.client ?? client).delete<
    TeamDeleteResponses,
    TeamDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zTeamDeletePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zTeamDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/teams/{id}',
    ...options,
  });

/**
 * Inspect a team
 *
 * Retrieve details about a team. Access is only available for administrator and leaders of that team.
 * **Access policy**: administrator
 */
export const teamInspect = <ThrowOnError extends boolean = true>(
  options: Options<TeamInspectData, ThrowOnError>
): RequestResult<TeamInspectResponses, TeamInspectErrors, ThrowOnError> =>
  (options.client ?? client).get<
    TeamInspectResponses,
    TeamInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zTeamInspectPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zTeamInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/teams/{id}',
    ...options,
  });

/**
 * Update a team
 *
 * Update a team.
 * **Access policy**: administrator
 */
export const teamUpdate = <ThrowOnError extends boolean = true>(
  options: Options<TeamUpdateData, ThrowOnError>
): RequestResult<TeamUpdateResponses, TeamUpdateErrors, ThrowOnError> =>
  (options.client ?? client).put<
    TeamUpdateResponses,
    TeamUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zTeamUpdateBody,
          path: zTeamUpdatePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zTeamUpdateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/teams/{id}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * List team memberships
 *
 * List team memberships. Access is only available to administrators and team leaders.
 * **Access policy**: restricted
 */
export const teamMemberships = <ThrowOnError extends boolean = true>(
  options: Options<TeamMembershipsData, ThrowOnError>
): RequestResult<
  TeamMembershipsResponses,
  TeamMembershipsErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    TeamMembershipsResponses,
    TeamMembershipsErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zTeamMembershipsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zTeamMembershipsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/teams/{id}/memberships',
    ...options,
  });

/**
 * List available templates
 *
 * List available templates.
 * **Access policy**: authenticated
 */
export const templateList = <ThrowOnError extends boolean = true>(
  options?: Options<TemplateListData, ThrowOnError>
): RequestResult<TemplateListResponses, TemplateListErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    TemplateListResponses,
    TemplateListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zTemplateListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/templates',
    ...options,
  });

/**
 * Get a template's file
 *
 * Get a template's file
 * **Access policy**: authenticated
 */
export const templateFile = <ThrowOnError extends boolean = true>(
  options: Options<TemplateFileData, ThrowOnError>
): RequestResult<TemplateFileResponses, TemplateFileErrors, ThrowOnError> =>
  (options.client ?? client).post<
    TemplateFileResponses,
    TemplateFileErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zTemplateFilePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zTemplateFileResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/templates/{id}/file',
    ...options,
  });

/**
 * Search Helm Charts
 *
 * **Access policy**: authenticated
 */
export const helmRepoSearch = <ThrowOnError extends boolean = true>(
  options: Options<HelmRepoSearchData, ThrowOnError>
): RequestResult<HelmRepoSearchResponses, HelmRepoSearchErrors, ThrowOnError> =>
  (options.client ?? client).get<
    HelmRepoSearchResponses,
    HelmRepoSearchErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zHelmRepoSearchQuery,
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zHelmRepoSearchResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/templates/helm',
    ...options,
  });

/**
 * Show Helm Chart Information
 *
 * **Access policy**: authenticated
 */
export const helmShow = <ThrowOnError extends boolean = true>(
  options: Options<HelmShowData, ThrowOnError>
): RequestResult<HelmShowResponses, HelmShowErrors, ThrowOnError> =>
  (options.client ?? client).get<
    HelmShowResponses,
    HelmShowErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zHelmShowPath,
          query: zHelmShowQuery,
        })
        .parseAsync(data),
    responseType: 'text',
    responseValidator: async (data) => await zHelmShowResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/templates/helm/{command}',
    ...options,
  });

/**
 * Upload TLS files
 *
 * Use this environment(endpoint) to upload TLS files.
 * **Access policy**: administrator
 */
export const uploadTls = <ThrowOnError extends boolean = true>(
  options: Options<UploadTlsData, ThrowOnError>
): RequestResult<UploadTlsResponses, UploadTlsErrors, ThrowOnError> =>
  (options.client ?? client).post<
    UploadTlsResponses,
    UploadTlsErrors,
    ThrowOnError
  >({
    ...formDataBodySerializer,
    requestValidator: async (data) =>
      await z
        .object({
          body: zUploadTlsBody,
          path: zUploadTlsPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zUploadTlsResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/upload/tls/{certificate}',
    ...options,
    headers: {
      'Content-Type': null,
      ...options.headers,
    },
  });

/**
 * List users
 *
 * List Portainer users.
 * Non-administrator users will only be able to list other non-administrator user accounts.
 * User passwords are filtered out, and should never be accessible.
 * **Access policy**: restricted
 */
export const userList = <ThrowOnError extends boolean = true>(
  options?: Options<UserListData, ThrowOnError>
): RequestResult<UserListResponses, UserListErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    UserListResponses,
    UserListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zUserListQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) => await zUserListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/users',
    ...options,
  });

/**
 * Create a new user
 *
 * Create a new Portainer user.
 * Only administrators can create users.
 * **Access policy**: restricted
 */
export const userCreate = <ThrowOnError extends boolean = true>(
  options: Options<UserCreateData, ThrowOnError>
): RequestResult<UserCreateResponses, UserCreateErrors, ThrowOnError> =>
  (options.client ?? client).post<
    UserCreateResponses,
    UserCreateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zUserCreateBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zUserCreateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/users',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Remove a user
 *
 * Remove a user.
 * **Access policy**: administrator
 */
export const userDelete = <ThrowOnError extends boolean = true>(
  options: Options<UserDeleteData, ThrowOnError>
): RequestResult<UserDeleteResponses, UserDeleteErrors, ThrowOnError> =>
  (options.client ?? client).delete<
    UserDeleteResponses,
    UserDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zUserDeletePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zUserDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/users/{id}',
    ...options,
  });

/**
 * Inspect a user
 *
 * Retrieve details about a user.
 * User passwords are filtered out, and should never be accessible.
 * **Access policy**: authenticated
 */
export const userInspect = <ThrowOnError extends boolean = true>(
  options: Options<UserInspectData, ThrowOnError>
): RequestResult<UserInspectResponses, UserInspectErrors, ThrowOnError> =>
  (options.client ?? client).get<
    UserInspectResponses,
    UserInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zUserInspectPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zUserInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/users/{id}',
    ...options,
  });

/**
 * Update a user
 *
 * Update user details. A regular user account can only update his details.
 * A regular user account cannot change their username or role.
 * **Access policy**: authenticated
 */
export const userUpdate = <ThrowOnError extends boolean = true>(
  options: Options<UserUpdateData, ThrowOnError>
): RequestResult<UserUpdateResponses, UserUpdateErrors, ThrowOnError> =>
  (options.client ?? client).put<
    UserUpdateResponses,
    UserUpdateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zUserUpdateBody,
          path: zUserUpdatePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zUserUpdateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/users/{id}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Inspect a user's effective access on every environment
 *
 * Returns the resolved role for each environment the user can access,
 * following the policy precedence used by the access viewer
 * (user-endpoint, user-group, team-endpoint, team-group).
 * Environments where the user has no role are omitted.
 * **Access policy**: restricted
 */
export const userEffectiveAccessInspect = <ThrowOnError extends boolean = true>(
  options: Options<UserEffectiveAccessInspectData, ThrowOnError>
): RequestResult<
  UserEffectiveAccessInspectResponses,
  UserEffectiveAccessInspectErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    UserEffectiveAccessInspectResponses,
    UserEffectiveAccessInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zUserEffectiveAccessInspectPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zUserEffectiveAccessInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/users/{id}/effective-access',
    ...options,
  });

/**
 * List a users helm repositories
 *
 * Inspect a user helm repositories.
 * **Access policy**: authenticated
 */
export const helmUserRepositoriesList = <ThrowOnError extends boolean = true>(
  options: Options<HelmUserRepositoriesListData, ThrowOnError>
): RequestResult<
  HelmUserRepositoriesListResponses,
  HelmUserRepositoriesListErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    HelmUserRepositoriesListResponses,
    HelmUserRepositoriesListErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zHelmUserRepositoriesListPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zHelmUserRepositoriesListResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/users/{id}/helm/repositories',
    ...options,
  });

/**
 * Create a user helm repository
 *
 * Create a user helm repository.
 * **Access policy**: authenticated
 */
export const helmUserRepositoryCreate = <ThrowOnError extends boolean = true>(
  options: Options<HelmUserRepositoryCreateData, ThrowOnError>
): RequestResult<
  HelmUserRepositoryCreateResponses,
  HelmUserRepositoryCreateErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    HelmUserRepositoryCreateResponses,
    HelmUserRepositoryCreateErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zHelmUserRepositoryCreateBody,
          path: zHelmUserRepositoryCreatePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zHelmUserRepositoryCreateResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/users/{id}/helm/repositories',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Delete a users helm repositoryies
 *
 * **Access policy**: authenticated
 */
export const helmUserRepositoryDelete = <ThrowOnError extends boolean = true>(
  options: Options<HelmUserRepositoryDeleteData, ThrowOnError>
): RequestResult<
  HelmUserRepositoryDeleteResponses,
  HelmUserRepositoryDeleteErrors,
  ThrowOnError
> =>
  (options.client ?? client).delete<
    HelmUserRepositoryDeleteResponses,
    HelmUserRepositoryDeleteErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zHelmUserRepositoryDeletePath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zHelmUserRepositoryDeleteResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/users/{id}/helm/repositories/{repositoryID}',
    ...options,
  });

/**
 * Inspect a user memberships
 *
 * Inspect a user memberships.
 * **Access policy**: restricted
 */
export const userMembershipsInspect = <ThrowOnError extends boolean = true>(
  options: Options<UserMembershipsInspectData, ThrowOnError>
): RequestResult<
  UserMembershipsInspectResponses,
  UserMembershipsInspectErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    UserMembershipsInspectResponses,
    UserMembershipsInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zUserMembershipsInspectPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zUserMembershipsInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/users/{id}/memberships',
    ...options,
  });

/**
 * Update password for a user
 *
 * Update password for the specified user.
 * **Access policy**: authenticated
 */
export const userUpdatePassword = <ThrowOnError extends boolean = true>(
  options: Options<UserUpdatePasswordData, ThrowOnError>
): RequestResult<
  UserUpdatePasswordResponses,
  UserUpdatePasswordErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    UserUpdatePasswordResponses,
    UserUpdatePasswordErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zUserUpdatePasswordBody,
          path: zUserUpdatePasswordPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zUserUpdatePasswordResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/users/{id}/passwd',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Get all API keys for a user
 *
 * Gets all API keys for a user.
 * Only the calling user or admin can retrieve api-keys.
 * **Access policy**: authenticated
 */
export const userGetApiKeys = <ThrowOnError extends boolean = true>(
  options: Options<UserGetApiKeysData, ThrowOnError>
): RequestResult<UserGetApiKeysResponses, UserGetApiKeysErrors, ThrowOnError> =>
  (options.client ?? client).get<
    UserGetApiKeysResponses,
    UserGetApiKeysErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zUserGetApiKeysPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zUserGetApiKeysResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/users/{id}/tokens',
    ...options,
  });

/**
 * Generate an API key for a user
 *
 * Generates an API key for a user.
 * Only the calling user can generate a token for themselves.
 * Password is required only for internal authentication.
 * **Access policy**: restricted
 */
export const userGenerateApiKey = <ThrowOnError extends boolean = true>(
  options: Options<UserGenerateApiKeyData, ThrowOnError>
): RequestResult<
  UserGenerateApiKeyResponses,
  UserGenerateApiKeyErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    UserGenerateApiKeyResponses,
    UserGenerateApiKeyErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zUserGenerateApiKeyBody,
          path: zUserGenerateApiKeyPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zUserGenerateApiKeyResponse.parseAsync(data),
    security: [{ name: 'Authorization', type: 'apiKey' }],
    url: '/users/{id}/tokens',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Remove an api-key associated to a user
 *
 * Remove an api-key associated to a user..
 * Only the calling user or admin can remove api-key.
 * **Access policy**: authenticated
 */
export const userRemoveApiKey = <ThrowOnError extends boolean = true>(
  options: Options<UserRemoveApiKeyData, ThrowOnError>
): RequestResult<
  UserRemoveApiKeyResponses,
  UserRemoveApiKeyErrors,
  ThrowOnError
> =>
  (options.client ?? client).delete<
    UserRemoveApiKeyResponses,
    UserRemoveApiKeyErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zUserRemoveApiKeyPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zUserRemoveApiKeyResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/users/{id}/tokens/{keyID}',
    ...options,
  });

/**
 * Check administrator account existence
 *
 * Check if an administrator account exists in the database.
 * **Access policy**: public
 */
export const userAdminCheck = <ThrowOnError extends boolean = true>(
  options?: Options<UserAdminCheckData, ThrowOnError>
): RequestResult<UserAdminCheckResponses, UserAdminCheckErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    UserAdminCheckResponses,
    UserAdminCheckErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseValidator: async (data) =>
      await zUserAdminCheckResponse.parseAsync(data),
    url: '/users/admin/check',
    ...options,
  });

/**
 * Initialize administrator account
 *
 * Initialize the 'admin' user account.
 * **Access policy**: public (requires the X-Setup-Token header on an uninitialized instance unless --no-setup-token is set)
 */
export const userAdminInit = <ThrowOnError extends boolean = true>(
  options: Options<UserAdminInitData, ThrowOnError>
): RequestResult<UserAdminInitResponses, UserAdminInitErrors, ThrowOnError> =>
  (options.client ?? client).post<
    UserAdminInitResponses,
    UserAdminInitErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zUserAdminInitBody,
          headers: zUserAdminInitHeaders.optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zUserAdminInitResponse.parseAsync(data),
    url: '/users/admin/init',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Inspect the current user user
 *
 * Retrieve details about the current  user.
 * User passwords are filtered out, and should never be accessible.
 * **Access policy**: authenticated
 */
export const currentUserInspect = <ThrowOnError extends boolean = true>(
  options?: Options<CurrentUserInspectData, ThrowOnError>
): RequestResult<
  CurrentUserInspectResponses,
  CurrentUserInspectErrors,
  ThrowOnError
> =>
  (options?.client ?? client).get<
    CurrentUserInspectResponses,
    CurrentUserInspectErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zCurrentUserInspectResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/users/me',
    ...options,
  });

/**
 * List webhooks
 *
 * **Access policy**: authenticated
 */
export const getWebhooks = <ThrowOnError extends boolean = true>(
  options?: Options<GetWebhooksData, ThrowOnError>
): RequestResult<GetWebhooksResponses, GetWebhooksErrors, ThrowOnError> =>
  (options?.client ?? client).get<
    GetWebhooksResponses,
    GetWebhooksErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zGetWebhooksQuery.optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zGetWebhooksResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/webhooks',
    ...options,
  });

/**
 * Create a webhook
 *
 * **Access policy**: authenticated
 */
export const postWebhooks = <ThrowOnError extends boolean = true>(
  options: Options<PostWebhooksData, ThrowOnError>
): RequestResult<PostWebhooksResponses, PostWebhooksErrors, ThrowOnError> =>
  (options.client ?? client).post<
    PostWebhooksResponses,
    PostWebhooksErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zPostWebhooksBody,
          path: z.never().optional(),
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zPostWebhooksResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/webhooks',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Delete a webhook
 *
 * **Access policy**: authenticated
 */
export const deleteWebhooksById = <ThrowOnError extends boolean = true>(
  options: Options<DeleteWebhooksByIdData, ThrowOnError>
): RequestResult<
  DeleteWebhooksByIdResponses,
  DeleteWebhooksByIdErrors,
  ThrowOnError
> =>
  (options.client ?? client).delete<
    DeleteWebhooksByIdResponses,
    DeleteWebhooksByIdErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zDeleteWebhooksByIdPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/webhooks/{id}',
    ...options,
  });

/**
 * Execute a webhook
 *
 * Acts on a passed in token UUID to restart the docker service
 * **Access policy**: public
 */
export const postWebhooksById = <ThrowOnError extends boolean = true>(
  options: Options<PostWebhooksByIdData, ThrowOnError>
): RequestResult<
  PostWebhooksByIdResponses,
  PostWebhooksByIdErrors,
  ThrowOnError
> =>
  (options.client ?? client).post<
    PostWebhooksByIdResponses,
    PostWebhooksByIdErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: zPostWebhooksByIdPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    url: '/webhooks/{id}',
    ...options,
  });

/**
 * Update a webhook
 *
 * **Access policy**: authenticated
 */
export const putWebhooksById = <ThrowOnError extends boolean = true>(
  options: Options<PutWebhooksByIdData, ThrowOnError>
): RequestResult<
  PutWebhooksByIdResponses,
  PutWebhooksByIdErrors,
  ThrowOnError
> =>
  (options.client ?? client).put<
    PutWebhooksByIdResponses,
    PutWebhooksByIdErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: zPutWebhooksByIdBody,
          path: zPutWebhooksByIdPath,
          query: z.never().optional(),
        })
        .parseAsync(data),
    responseType: 'json',
    responseValidator: async (data) =>
      await zPutWebhooksByIdResponse.parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/webhooks/{id}',
    ...options,
    headers: {
      'Content-Type': 'application/json',
      ...options.headers,
    },
  });

/**
 * Attach a websocket
 *
 * If the nodeName query parameter is present, the request will be proxied to the underlying agent environment(endpoint).
 * If the nodeName query parameter is not specified, the request will be upgraded to the websocket protocol and
 * an AttachStart operation HTTP request will be created and hijacked.
 * **Access policy**: authenticated
 */
export const getWebsocketAttach = <ThrowOnError extends boolean = true>(
  options: Options<GetWebsocketAttachData, ThrowOnError>
): RequestResult<
  GetWebsocketAttachResponses,
  GetWebsocketAttachErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetWebsocketAttachResponses,
    GetWebsocketAttachErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zGetWebsocketAttachQuery,
        })
        .parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/websocket/attach',
    ...options,
  });

/**
 * Execute a websocket
 *
 * If the nodeName query parameter is present, the request will be proxied to the underlying agent environment(endpoint).
 * If the nodeName query parameter is not specified, the request will be upgraded to the websocket protocol and
 * an ExecStart operation HTTP request will be created and hijacked.
 */
export const getWebsocketExec = <ThrowOnError extends boolean = true>(
  options: Options<GetWebsocketExecData, ThrowOnError>
): RequestResult<
  GetWebsocketExecResponses,
  GetWebsocketExecErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetWebsocketExecResponses,
    GetWebsocketExecErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zGetWebsocketExecQuery,
        })
        .parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/websocket/exec',
    ...options,
  });

/**
 * Execute a websocket on kubectl shell pod
 *
 * The request will be upgraded to the websocket protocol. The request will proxy input from the client to the pod via long-lived websocket connection.
 * **Access policy**: authenticated
 */
export const getWebsocketKubernetesShell = <
  ThrowOnError extends boolean = true,
>(
  options: Options<GetWebsocketKubernetesShellData, ThrowOnError>
): RequestResult<
  GetWebsocketKubernetesShellResponses,
  GetWebsocketKubernetesShellErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetWebsocketKubernetesShellResponses,
    GetWebsocketKubernetesShellErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zGetWebsocketKubernetesShellQuery,
        })
        .parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/websocket/kubernetes-shell',
    ...options,
  });

/**
 * Execute a websocket on pod
 *
 * The request will be upgraded to the websocket protocol.
 * **Access policy**: authenticated
 */
export const getWebsocketPod = <ThrowOnError extends boolean = true>(
  options: Options<GetWebsocketPodData, ThrowOnError>
): RequestResult<
  GetWebsocketPodResponses,
  GetWebsocketPodErrors,
  ThrowOnError
> =>
  (options.client ?? client).get<
    GetWebsocketPodResponses,
    GetWebsocketPodErrors,
    ThrowOnError
  >({
    requestValidator: async (data) =>
      await z
        .object({
          body: z.never().optional(),
          path: z.never().optional(),
          query: zGetWebsocketPodQuery,
        })
        .parseAsync(data),
    security: [
      { name: 'X-API-KEY', type: 'apiKey' },
      { name: 'Authorization', type: 'apiKey' },
    ],
    url: '/websocket/pod',
    ...options,
  });
