From ec46856ee22f147ece6f1b7b6ea23cf0b1a98b6b Mon Sep 17 00:00:00 2001 From: "quantcloud[bot]" Date: Sun, 12 Jul 2026 17:26:44 +0000 Subject: [PATCH] feat(sdk): v4.20.0 - Auto-generated from unified API spec Generated from unified API spec v4.20.0 Changes: - Auto-generated SDK updates This PR was automatically created by the API generation pipeline. --- .openapi-generator/FILES | 264 +- README.md | 225 +- composer.json | 2 +- composer.lock | 213 +- docs/Api/AIAgentsApi.md | 191 + docs/Api/AIApi.md | 77 + docs/Api/AICustomToolsApi.md | 67 +- docs/Api/AIFilterPoliciesApi.md | 434 ++ docs/Api/AIGovernanceApi.md | 186 + docs/Api/AIOrchestrationsApi.md | 581 ++ docs/Api/AISearchApi.md | 1065 ++++ docs/Api/AISkillsApi.md | 704 +++ docs/Api/AISlackBotsApi.md | 452 ++ docs/Api/AIToolsApi.md | 6 +- .../Api/{AIMonitoringApi.md => AIUsageApi.md} | 20 +- docs/Api/AIVectorDatabaseApi.md | 137 +- docs/Api/CDNMetricsApi.md | 214 + docs/Api/KVApi.md | 132 + docs/Api/OpenAICompatibilityApi.md | 248 + docs/Api/OrchestrationApi.md | 70 - docs/Api/RestoreManagementApi.md | 212 + docs/Api/ScalingPolicyApi.md | 100 +- docs/Api/SubscriptionApi.md | 69 + docs/Api/TokensApi.md | 188 + docs/Model/AiSearchChatRequest.md | 12 + ...Value.md => AiSearchDeletePagesRequest.md} | 6 +- docs/Model/AiSearchEnableRequest.md | 10 + docs/Model/AiSearchIngestPagesRequest.md | 10 + .../AiSearchIngestPagesRequestPagesInner.md | 17 + docs/Model/AiSearchSearchRequest.md | 11 + docs/Model/AiSearchTriggerCrawlRequest.md | 9 + docs/Model/AiSearchUpdateSettingsRequest.md | 10 + docs/Model/Application.md | 9 +- docs/Model/ApplicationCache.md | 11 + docs/Model/ApplicationEnvironmentsInner.md | 12 - docs/Model/ChatInference200ResponseUsage.md | 1 + docs/Model/ChatInferenceRequest.md | 3 + docs/Model/ChatInferenceRequestGuardrails.md | 11 + docs/Model/ChatInferenceStreamRequest.md | 3 + ...ChatWithAIAgent200ResponseResponseUsage.md | 2 + docs/Model/ChatWithAIAgentRequest.md | 3 + docs/Model/Compose.md | 2 + docs/Model/ContainerOriginProtectionConfig.md | 1 + docs/Model/CreateAIAgentRequest.md | 4 + docs/Model/CreateCustomTool201Response.md | 3 + docs/Model/CreateCustomToolRequest.md | 8 +- docs/Model/CreateEnvironmentRequest.md | 2 + docs/Model/CreateFilterPolicyRequest.md | 12 + .../CreateFilterPolicyRequestRulesInner.md | 12 + ...reateFilterPolicyRequestRulesInnerMatch.md | 11 + docs/Model/CreateOrchestrationRequest.md | 20 + .../CreateOrchestrationRequestInputSource.md | 12 + ...CreateOrchestrationRequestStopCondition.md | 11 + docs/Model/CreateSkill201Response.md | 11 + docs/Model/CreateSkillRequest.md | 19 + docs/Model/CreateSlackBot201Response.md | 9 + docs/Model/CreateSlackBotRequest.md | 30 + docs/Model/CreateVectorCollectionRequest.md | 2 +- docs/Model/Cron.md | 7 +- ...se.md => DeleteAgentOverlay200Response.md} | 2 +- docs/Model/DeleteSkill200Response.md | 10 + .../Model/DeleteSkillCollection200Response.md | 10 + docs/Model/DeleteSlackBot200Response.md | 10 + .../Model/DeleteVectorDocuments200Response.md | 11 + docs/Model/DeleteVectorDocumentsRequest.md | 12 + .../DeleteVectorDocumentsRequestMetadata.md | 10 + docs/Model/EnvironmentResponse.md | 38 +- docs/Model/GetAIAgent200ResponseAgent.md | 5 + .../GetAIOrchestrationStatus200Response.md | 3 +- docs/Model/GetAIUsageStats200Response.md | 11 - docs/Model/GetAgentOverlay200Response.md | 10 + docs/Model/GetAgentOverlay200ResponseBase.md | 13 + .../GetAgentOverlay200ResponseOverlay.md | 19 + docs/Model/GetCustomTool200Response.md | 9 + docs/Model/GetCustomTool200ResponseTool.md | 19 + ...leExecutionStatus200ResponseResultUsage.md | 1 + docs/Model/GetGovernanceConfig200Response.md | 16 + ...tGovernanceConfig200ResponseSpendLimits.md | 18 + ...ResponseSpendLimitsInterfaceLimitsValue.md | 10 + ...00ResponseSpendLimitsUserOverridesValue.md | 11 + docs/Model/GetGovernanceSpend200Response.md | 13 + .../GetGovernanceSpend200ResponseBudget.md | 11 + ...etGovernanceSpend200ResponseDailyBudget.md | 11 + .../GetGovernanceSpend200ResponseOrgTotal.md | 10 + ...GetGovernanceSpend200ResponseTodayTotal.md | 10 + .../GetGovernanceSpend200ResponseUserTotal.md | 10 + docs/Model/GetMyUsage200Response.md | 13 + docs/Model/GetMyUsage200ResponseDaily.md | 9 + docs/Model/GetMyUsage200ResponseMonthly.md | 10 + docs/Model/GetMyUsage200ResponseQuota.md | 10 + .../GetMyUsage200ResponseQuotaDailyLimit.md | 12 + .../GetMyUsage200ResponseQuotaMonthlyLimit.md | 11 + docs/Model/GetRestoreStatus200Response.md | 19 + ...gPolicy.md => GetScalingPolicyResponse.md} | 4 +- docs/Model/GetSkill200Response.md | 9 + docs/Model/GetSkill200ResponseSkill.md | 22 + docs/Model/GetSlackBot200Response.md | 9 + docs/Model/GetSlackBot200ResponseBot.md | 35 + docs/Model/ImportSkill201Response.md | 10 + .../Model/ImportSkillCollection201Response.md | 13 + docs/Model/ImportSkillCollectionRequest.md | 12 + .../ImportSkillCollectionRequestSource.md | 12 + docs/Model/ImportSkillRequest.md | 17 + docs/Model/ImportSkillRequestSource.md | 13 + docs/Model/KVLinkToProject200Response.md | 10 + docs/Model/KVLinkToProjectRequest.md | 9 + .../ListAIAgents200ResponseAgentsInner.md | 5 + .../ListCustomTools200ResponseToolsInner.md | 2 +- .../ListOrchestrationBatches200Response.md | 10 + ...estrationBatches200ResponseBatchesInner.md | 18 + docs/Model/ListOrchestrations200Response.md | 10 + docs/Model/ListSkillCollections200Response.md | 9 + ...lCollections200ResponseCollectionsInner.md | 11 + docs/Model/ListSkills200Response.md | 10 + .../Model/ListSkills200ResponseSkillsInner.md | 17 + docs/Model/ListSlackBots200Response.md | 9 + .../ListSlackBots200ResponseBotsInner.md | 27 + docs/Model/OaiChatCompletions200Response.md | 14 + ...iChatCompletions200ResponseChoicesInner.md | 11 + ...mpletions200ResponseChoicesInnerMessage.md | 11 + .../OaiChatCompletions200ResponseUsage.md | 11 + docs/Model/OaiChatCompletionsRequest.md | 17 + .../OaiChatCompletionsRequestMessagesInner.md | 10 + docs/Model/OaiEmbeddings200Response.md | 12 + .../OaiEmbeddings200ResponseDataInner.md | 11 + docs/Model/OaiEmbeddings200ResponseUsage.md | 10 + docs/Model/OaiEmbeddingsRequest.md | 10 + docs/Model/OaiGetModel200Response.md | 12 + docs/Model/OaiListModels200Response.md | 10 + .../OaiListModels200ResponseDataInner.md | 12 + docs/Model/PatchEnvironmentComposeRequest.md | 2 + docs/Model/RestoreDatabase202Response.md | 11 + docs/Model/RestoreDatabaseRequest.md | 10 + docs/Model/RestoreFilesystem202Response.md | 11 + docs/Model/RestoreFilesystemRequest.md | 10 + docs/Model/ScalingPolicyListResponse.md | 9 + ...SearchSlackWorkspaceChannels200Response.md | 9 + ...orkspaceChannels200ResponseResultsInner.md | 10 + .../SearchSlackWorkspaceUsers200Response.md | 9 + ...ckWorkspaceUsers200ResponseResultsInner.md | 11 + docs/Model/SetScalingPolicyRequest.md | 12 + docs/Model/SyncSkillCollection200Response.md | 14 + docs/Model/TokensCreate201Response.md | 16 + docs/Model/TokensCreateRequest.md | 13 + docs/Model/TokensDelete200Response.md | 9 + docs/Model/TokensList200ResponseInner.md | 12 + docs/Model/UpdateAIAgentRequest.md | 4 + docs/Model/UpdateFilterPolicyRequest.md | 12 + .../UpdateGovernanceConfig200Response.md | 10 + docs/Model/UpdateGovernanceConfigRequest.md | 15 + docs/Model/UpdateSkill200Response.md | 11 + docs/Model/UpdateSkillRequest.md | 19 + docs/Model/UpdateSlackBotRequest.md | 30 + ...oadVectorDocumentsRequestDocumentsInner.md | 1 + docs/Model/UpsertAgentOverlay200Response.md | 9 + docs/Model/UpsertAgentOverlayRequest.md | 19 + docs/Model/V2CrawlerSchedule.md | 2 +- docs/Model/V2CrawlerScheduleRequest.md | 4 +- docs/Model/V2MetricData.md | 12 + docs/Model/V2MetricDataPoint.md | 10 + docs/Model/V2MetricDataPointTimestamp.md | 8 + docs/Model/V2MetricsMeta.md | 14 + docs/Model/V2MetricsResponse.md | 10 + docs/Model/V2Rule.md | 3 + docs/Model/V2RuleAuth.md | 3 + docs/Model/V2RuleAuthRequest.md | 3 + docs/Model/V2RuleBotChallenge.md | 3 + docs/Model/V2RuleBotChallengeRequest.md | 3 + docs/Model/V2RuleContentFilter.md | 3 + docs/Model/V2RuleContentFilterRequest.md | 3 + docs/Model/V2RuleCustomResponse.md | 3 + docs/Model/V2RuleCustomResponseRequest.md | 3 + docs/Model/V2RuleFunction.md | 3 + docs/Model/V2RuleFunctionRequest.md | 3 + docs/Model/V2RuleHeader.md | 3 + docs/Model/V2RuleHeaderRequest.md | 3 + docs/Model/V2RuleProxy.md | 3 + docs/Model/V2RuleProxyRequest.md | 3 + docs/Model/V2RuleRedirect.md | 3 + docs/Model/V2RuleRedirectRequest.md | 3 + docs/Model/V2RuleRequest.md | 3 + docs/Model/V2RuleServeStatic.md | 3 + docs/Model/V2RuleServeStaticRequest.md | 3 + src/Api/AIAgentsApi.php | 1180 ++++- src/Api/{OrchestrationApi.php => AIApi.php} | 244 +- src/Api/AICustomToolsApi.php | 297 +- src/Api/AIFileStorageApi.php | 2 +- src/Api/AIFilterPoliciesApi.php | 2249 ++++++++ src/Api/AIGovernanceApi.php | 1030 ++++ src/Api/AIInferenceApi.php | 2 +- src/Api/AIModelsApi.php | 2 +- src/Api/AIOrchestrationsApi.php | 2857 ++++++++++ src/Api/AISearchApi.php | 4677 +++++++++++++++++ src/Api/AISessionsApi.php | 2 +- src/Api/AISkillsApi.php | 3458 ++++++++++++ src/Api/AISlackBotsApi.php | 2279 ++++++++ src/Api/AITaskManagementApi.php | 2 +- src/Api/AIToolsApi.php | 10 +- .../{AIMonitoringApi.php => AIUsageApi.php} | 87 +- src/Api/AIVectorDatabaseApi.php | 621 ++- src/Api/ApplicationsApi.php | 2 +- src/Api/BackupManagementApi.php | 2 +- src/Api/CDNMetricsApi.php | 1206 +++++ src/Api/CommandsApi.php | 2 +- src/Api/ComposeApi.php | 2 +- src/Api/ContainersApi.php | 2 +- src/Api/CrawlerSchedulesApi.php | 2 +- src/Api/CrawlersApi.php | 2 +- src/Api/CronApi.php | 2 +- src/Api/DomainsApi.php | 2 +- src/Api/EnvironmentsApi.php | 2 +- src/Api/HeadersApi.php | 2 +- src/Api/KVApi.php | 907 +++- src/Api/OpenAICompatibilityApi.php | 1264 +++++ src/Api/OrganizationsApi.php | 2 +- src/Api/ProjectsApi.php | 2 +- src/Api/PurgeApi.php | 2 +- src/Api/RestoreManagementApi.php | 1257 +++++ src/Api/RulesApi.php | 2 +- src/Api/SSHAccessApi.php | 2 +- src/Api/ScalingPolicyApi.php | 467 +- src/Api/SubscriptionApi.php | 426 ++ src/Api/TokensApi.php | 1134 ++++ src/Api/VariablesApi.php | 2 +- src/Api/VolumesApi.php | 2 +- src/ApiException.php | 2 +- src/Configuration.php | 8 +- src/FormDataProcessor.php | 2 +- src/HeaderSelector.php | 2 +- src/Model/AiSearchChatRequest.php | 523 ++ src/Model/AiSearchDeletePagesRequest.php | 443 ++ src/Model/AiSearchEnableRequest.php | 443 ++ src/Model/AiSearchIngestPagesRequest.php | 446 ++ .../AiSearchIngestPagesRequestPagesInner.php | 690 +++ src/Model/AiSearchSearchRequest.php | 489 ++ src/Model/AiSearchTriggerCrawlRequest.php | 412 ++ src/Model/AiSearchUpdateSettingsRequest.php | 443 ++ src/Model/Application.php | 79 +- src/Model/ApplicationCache.php | 499 ++ src/Model/ApplicationDatabase.php | 2 +- .../ApplicationDeploymentInformationInner.php | 2 +- src/Model/ApplicationFilesystem.php | 2 +- src/Model/ApplicationImageReference.php | 2 +- .../BulkSetEnvironmentVariablesRequest.php | 2 +- ...onmentVariablesRequestEnvironmentInner.php | 2 +- src/Model/ChatInference200Response.php | 2 +- .../ChatInference200ResponseResponse.php | 2 +- ...hatInference200ResponseResponseToolUse.php | 2 +- ...ference200ResponseResponseToolUseOneOf.php | 2 +- ...e200ResponseResponseToolUseOneOf1Inner.php | 2 +- ...e200ResponseResponseToolUseOneOfResult.php | 2 +- src/Model/ChatInference200ResponseUsage.php | 50 +- src/Model/ChatInference202Response.php | 2 +- src/Model/ChatInferenceRequest.php | 116 +- src/Model/ChatInferenceRequestGuardrails.php | 512 ++ .../ChatInferenceRequestMessagesInner.php | 2 +- ...atInferenceRequestMessagesInnerContent.php | 2 +- ...eRequestMessagesInnerContentOneOfInner.php | 2 +- ...estMessagesInnerContentOneOfInnerOneOf.php | 2 +- ...stMessagesInnerContentOneOfInnerOneOf1.php | 2 +- ...sagesInnerContentOneOfInnerOneOf1Image.php | 2 +- ...nnerContentOneOfInnerOneOf1ImageSource.php | 2 +- ...stMessagesInnerContentOneOfInnerOneOf2.php | 2 +- ...sagesInnerContentOneOfInnerOneOf2Video.php | 2 +- ...nnerContentOneOfInnerOneOf2VideoSource.php | 2 +- ...stMessagesInnerContentOneOfInnerOneOf3.php | 2 +- ...esInnerContentOneOfInnerOneOf3Document.php | 2 +- ...rContentOneOfInnerOneOf3DocumentSource.php | 2 +- .../ChatInferenceRequestResponseFormat.php | 2 +- src/Model/ChatInferenceRequestToolConfig.php | 2 +- ...atInferenceRequestToolConfigToolsInner.php | 2 +- ...nceRequestToolConfigToolsInnerToolSpec.php | 2 +- ...oolConfigToolsInnerToolSpecInputSchema.php | 2 +- src/Model/ChatInferenceStreamRequest.php | 116 +- ...hatInferenceStreamRequestMessagesInner.php | 2 +- ...renceStreamRequestMessagesInnerContent.php | 2 +- src/Model/ChatWithAIAgent200Response.php | 2 +- .../ChatWithAIAgent200ResponseResponse.php | 2 +- ...hatWithAIAgent200ResponseResponseUsage.php | 82 +- src/Model/ChatWithAIAgent202Response.php | 2 +- src/Model/ChatWithAIAgentRequest.php | 132 +- src/Model/Command.php | 2 +- src/Model/Compose.php | 100 +- src/Model/Container.php | 2 +- src/Model/ContainerDependsOnInner.php | 2 +- src/Model/ContainerEnvironmentInner.php | 2 +- src/Model/ContainerHealthCheck.php | 2 +- src/Model/ContainerImageReference.php | 2 +- src/Model/ContainerMountPointsInner.php | 2 +- src/Model/ContainerOriginProtectionConfig.php | 55 +- src/Model/ContainerSecretsInner.php | 2 +- src/Model/CrawlersRun200Response.php | 2 +- src/Model/CrawlersRunRequest.php | 2 +- src/Model/CreateAIAgent201Response.php | 2 +- src/Model/CreateAIAgentRequest.php | 193 +- src/Model/CreateAISession201Response.php | 2 +- src/Model/CreateAISessionRequest.php | 2 +- ...teAISessionRequestInitialMessagesInner.php | 2 +- src/Model/CreateApplication403Response.php | 2 +- src/Model/CreateApplicationRequest.php | 2 +- .../CreateApplicationRequestDatabase.php | 2 +- ...eateApplicationRequestEnvironmentInner.php | 2 +- .../CreateApplicationRequestFilesystem.php | 2 +- src/Model/CreateBackup202Response.php | 2 +- src/Model/CreateBackupRequest.php | 2 +- src/Model/CreateCommandRequest.php | 2 +- src/Model/CreateCronJobRequest.php | 2 +- src/Model/CreateCustomTool201Response.php | 104 +- src/Model/CreateCustomToolRequest.php | 262 +- src/Model/CreateEnvironment403Response.php | 2 +- src/Model/CreateEnvironmentRequest.php | 100 +- ...eateEnvironmentRequestEnvironmentInner.php | 2 +- src/Model/CreateFilterPolicyRequest.php | 555 ++ .../CreateFilterPolicyRequestRulesInner.php | 581 ++ ...eateFilterPolicyRequestRulesInnerMatch.php | 520 ++ src/Model/CreateOrchestrationRequest.php | 856 +++ .../CreateOrchestrationRequestInputSource.php | 550 ++ ...reateOrchestrationRequestStopCondition.php | 524 ++ src/Model/CreateSkill201Response.php | 477 ++ src/Model/CreateSkillRequest.php | 758 +++ src/Model/CreateSlackBot201Response.php | 409 ++ src/Model/CreateSlackBotRequest.php | 1210 +++++ src/Model/CreateTask201Response.php | 2 +- src/Model/CreateTaskRequest.php | 2 +- .../CreateVectorCollection201Response.php | 2 +- ...eVectorCollection201ResponseCollection.php | 2 +- src/Model/CreateVectorCollectionRequest.php | 9 +- src/Model/CreateVolumeRequest.php | 2 +- src/Model/Cron.php | 166 +- src/Model/CronRun.php | 2 +- src/Model/DeleteAIAgent200Response.php | 2 +- src/Model/DeleteAISession200Response.php | 2 +- ....php => DeleteAgentOverlay200Response.php} | 10 +- src/Model/DeleteBackup200Response.php | 2 +- src/Model/DeleteCustomTool200Response.php | 2 +- src/Model/DeleteFile200Response.php | 2 +- src/Model/DeleteSkill200Response.php | 443 ++ .../DeleteSkillCollection200Response.php | 443 ++ src/Model/DeleteSlackBot200Response.php | 443 ++ src/Model/DeleteTask200Response.php | 2 +- src/Model/DeleteTask409Response.php | 2 +- .../DeleteVectorDocuments200Response.php | 477 ++ src/Model/DeleteVectorDocumentsRequest.php | 511 ++ .../DeleteVectorDocumentsRequestMetadata.php | 443 ++ src/Model/DownloadBackup200Response.php | 2 +- src/Model/Embeddings200Response.php | 2 +- src/Model/Embeddings200ResponseEmbeddings.php | 2 +- src/Model/Embeddings200ResponseUsage.php | 2 +- src/Model/EmbeddingsRequest.php | 2 +- src/Model/EmbeddingsRequestInput.php | 2 +- src/Model/Environment.php | 2 +- src/Model/EnvironmentResponse.php | 42 +- src/Model/EnvironmentSummary.php | 2 +- src/Model/ExtendAISession200Response.php | 2 +- src/Model/ExtendAISessionRequest.php | 2 +- src/Model/GetAIAgent200Response.php | 2 +- src/Model/GetAIAgent200ResponseAgent.php | 172 +- src/Model/GetAIModel200Response.php | 2 +- .../GetAIModel200ResponseCapabilities.php | 2 +- src/Model/GetAIModel200ResponsePricing.php | 2 +- src/Model/GetAIModel404Response.php | 2 +- .../GetAIOrchestrationStatus200Response.php | 84 +- ...chestrationStatus200ResponseToolsInner.php | 2 +- .../GetAIOrchestrationStatus404Response.php | 2 +- src/Model/GetAISession200Response.php | 2 +- .../GetAIToolExecutionStatus200Response.php | 2 +- ...AIToolExecutionStatus200ResponseResult.php | 2 +- .../GetAIToolExecutionStatus404Response.php | 2 +- src/Model/GetAgentOverlay200Response.php | 450 ++ src/Model/GetAgentOverlay200ResponseBase.php | 546 ++ .../GetAgentOverlay200ResponseOverlay.php | 749 +++ src/Model/GetCustomTool200Response.php | 409 ++ src/Model/GetCustomTool200ResponseTool.php | 811 +++ src/Model/GetDependencyGraph200Response.php | 2 +- .../GetDurableExecutionStatus200Response.php | 2 +- ...DurableExecutionStatus200ResponseError.php | 2 +- ...tionStatus200ResponsePendingToolsInner.php | 2 +- ...urableExecutionStatus200ResponseResult.php | 2 +- ...ecutionStatus200ResponseResultResponse.php | 2 +- ...eExecutionStatus200ResponseResultUsage.php | 49 +- .../GetEcrLoginCredentials200Response.php | 2 +- src/Model/GetEnvironmentLogs200Response.php | 2 +- ...vironmentLogs200ResponseLogEventsInner.php | 2 +- src/Model/GetFile200Response.php | 2 +- src/Model/GetGovernanceConfig200Response.php | 690 +++ ...GovernanceConfig200ResponseSpendLimits.php | 764 +++ ...esponseSpendLimitsInterfaceLimitsValue.php | 457 ++ ...0ResponseSpendLimitsUserOverridesValue.php | 498 ++ src/Model/GetGovernanceSpend200Response.php | 566 ++ .../GetGovernanceSpend200ResponseBudget.php | 477 ++ ...tGovernanceSpend200ResponseDailyBudget.php | 477 ++ .../GetGovernanceSpend200ResponseOrgTotal.php | 443 ++ ...etGovernanceSpend200ResponseTodayTotal.php | 443 ++ ...GetGovernanceSpend200ResponseUserTotal.php | 443 ++ src/Model/GetMyUsage200Response.php | 552 ++ src/Model/GetMyUsage200ResponseDaily.php | 409 ++ src/Model/GetMyUsage200ResponseMonthly.php | 443 ++ src/Model/GetMyUsage200ResponseQuota.php | 457 ++ .../GetMyUsage200ResponseQuotaDailyLimit.php | 512 ++ ...GetMyUsage200ResponseQuotaMonthlyLimit.php | 478 ++ src/Model/GetRestoreStatus200Response.php | 815 +++ src/Model/GetScalingPolicyResponse.php | 622 +++ src/Model/GetSkill200Response.php | 409 ++ src/Model/GetSkill200ResponseSkill.php | 851 +++ src/Model/GetSlackBot200Response.php | 409 ++ src/Model/GetSlackBot200ResponseBot.php | 1361 +++++ .../GetSshAccessCredentials200Response.php | 2 +- ...ccessCredentials200ResponseCredentials.php | 2 +- src/Model/GetTask200Response.php | 2 +- src/Model/GetVectorCollection200Response.php | 2 +- ...tVectorCollection200ResponseCollection.php | 2 +- src/Model/ImageGeneration200Response.php | 2 +- src/Model/ImageGenerationRequest.php | 2 +- ...nerationRequestBackgroundRemovalParams.php | 2 +- ...tionRequestColorGuidedGenerationParams.php | 2 +- ...GenerationRequestImageGenerationConfig.php | 2 +- ...eGenerationRequestImageVariationParams.php | 2 +- ...ImageGenerationRequestInPaintingParams.php | 2 +- ...mageGenerationRequestOutPaintingParams.php | 2 +- ...mageGenerationRequestTextToImageParams.php | 2 +- src/Model/ImportSkill201Response.php | 443 ++ .../ImportSkillCollection201Response.php | 545 ++ src/Model/ImportSkillCollectionRequest.php | 526 ++ .../ImportSkillCollectionRequestSource.php | 549 ++ src/Model/ImportSkillRequest.php | 684 +++ src/Model/ImportSkillRequestSource.php | 582 ++ src/Model/KVItemsCreate200Response.php | 2 +- src/Model/KVItemsDelete200Response.php | 2 +- src/Model/KVItemsShow200Response.php | 2 +- src/Model/KVItemsShow200ResponseValue.php | 2 +- src/Model/KVLinkToProject200Response.php | 443 ++ src/Model/KVLinkToProjectRequest.php | 412 ++ src/Model/ListAIAgents200Response.php | 2 +- .../ListAIAgents200ResponseAgentsInner.php | 172 +- src/Model/ListAIModels200Response.php | 2 +- .../ListAIModels200ResponseModelsInner.php | 2 +- ...dels200ResponseModelsInnerCapabilities.php | 2 +- src/Model/ListAISessions200ResponseInner.php | 2 +- src/Model/ListAIToolExecutions200Response.php | 2 +- ...olExecutions200ResponseExecutionsInner.php | 2 +- src/Model/ListAIToolNames200Response.php | 2 +- src/Model/ListAITools200Response.php | 2 +- .../ListAITools200ResponseToolsInner.php | 2 +- ...stAITools200ResponseToolsInnerToolSpec.php | 2 +- ...0ResponseToolsInnerToolSpecInputSchema.php | 2 +- src/Model/ListBackups200Response.php | 2 +- .../ListBackups200ResponseBackupsInner.php | 2 +- src/Model/ListBackups422Response.php | 2 +- src/Model/ListCustomTools200Response.php | 2 +- .../ListCustomTools200ResponseToolsInner.php | 8 +- src/Model/ListFiles200Response.php | 2 +- src/Model/ListFiles200ResponseFilesInner.php | 2 +- .../ListOrchestrationBatches200Response.php | 450 ++ ...strationBatches200ResponseBatchesInner.php | 760 +++ src/Model/ListOrchestrations200Response.php | 450 ++ src/Model/ListSkillCollections200Response.php | 409 ++ ...Collections200ResponseCollectionsInner.php | 477 ++ ...delValue.php => ListSkills200Response.php} | 76 +- .../ListSkills200ResponseSkillsInner.php | 681 +++ src/Model/ListSlackBots200Response.php | 409 ++ .../ListSlackBots200ResponseBotsInner.php | 1089 ++++ src/Model/ListTasks200Response.php | 2 +- src/Model/ListTasks200ResponseTasksInner.php | 2 +- .../ListVectorCollections200Response.php | 2 +- ...Collections200ResponseCollectionsInner.php | 2 +- src/Model/ModelInterface.php | 2 +- src/Model/OaiChatCompletions200Response.php | 579 ++ ...ChatCompletions200ResponseChoicesInner.php | 513 ++ ...pletions200ResponseChoicesInnerMessage.php | 484 ++ ...=> OaiChatCompletions200ResponseUsage.php} | 106 +- src/Model/OaiChatCompletionsRequest.php | 694 +++ ...OaiChatCompletionsRequestMessagesInner.php | 481 ++ src/Model/OaiEmbeddings200Response.php | 511 ++ .../OaiEmbeddings200ResponseDataInner.php | 477 ++ src/Model/OaiEmbeddings200ResponseUsage.php | 443 ++ src/Model/OaiEmbeddingsRequest.php | 456 ++ src/Model/OaiGetModel200Response.php | 511 ++ src/Model/OaiListModels200Response.php | 443 ++ .../OaiListModels200ResponseDataInner.php | 511 ++ .../OrganizationsList200ResponseInner.php | 2 +- .../PatchEnvironmentCompose202Response.php | 2 +- ...entCompose202ResponseSpotConfiguration.php | 2 +- .../PatchEnvironmentCompose400Response.php | 2 +- src/Model/PatchEnvironmentComposeRequest.php | 100 +- ...ronmentComposeRequestSpotConfiguration.php | 2 +- src/Model/PurgeCreateRequest.php | 2 +- .../QueryVectorCollection200Response.php | 2 +- ...yVectorCollection200ResponsePagination.php | 2 +- ...ectorCollection200ResponseResultsInner.php | 2 +- src/Model/QueryVectorCollectionRequest.php | 2 +- .../QueryVectorCollectionRequestFilter.php | 2 +- src/Model/RestoreDatabase202Response.php | 477 ++ src/Model/RestoreDatabaseRequest.php | 449 ++ ...r.php => RestoreFilesystem202Response.php} | 112 +- src/Model/RestoreFilesystemRequest.php | 449 ++ src/Model/ScalingPolicyListResponse.php | 409 ++ ...earchSlackWorkspaceChannels200Response.php | 409 ++ ...rkspaceChannels200ResponseResultsInner.php | 443 ++ .../SearchSlackWorkspaceUsers200Response.php | 409 ++ ...kWorkspaceUsers200ResponseResultsInner.php | 477 ++ ...Policy.php => SetScalingPolicyRequest.php} | 34 +- src/Model/SpotConfiguration.php | 2 +- src/Model/SubmitToolCallback200Response.php | 2 +- src/Model/SubmitToolCallbackRequest.php | 2 +- ...mitToolCallbackRequestToolResultsInner.php | 2 +- src/Model/SyncOperation.php | 2 +- src/Model/SyncSkillCollection200Response.php | 579 ++ src/Model/SyncToEnvironmentRequest.php | 2 +- src/Model/TokensCreate201Response.php | 675 +++ src/Model/TokensCreateRequest.php | 614 +++ src/Model/TokensDelete200Response.php | 409 ++ src/Model/TokensList200ResponseInner.php | 518 ++ src/Model/UpdateAIAgent200Response.php | 2 +- src/Model/UpdateAIAgentRequest.php | 193 +- src/Model/UpdateAISession200Response.php | 2 +- src/Model/UpdateAISessionRequest.php | 2 +- ...UpdateAISessionRequestNewMessagesInner.php | 2 +- src/Model/UpdateCronJobRequest.php | 2 +- src/Model/UpdateEnvironmentRequest.php | 2 +- src/Model/UpdateEnvironmentStateRequest.php | 2 +- .../UpdateEnvironmentVariableRequest.php | 2 +- src/Model/UpdateFilterPolicyRequest.php | 549 ++ .../UpdateGovernanceConfig200Response.php | 443 ++ src/Model/UpdateGovernanceConfigRequest.php | 698 +++ src/Model/UpdateSkill200Response.php | 477 ++ src/Model/UpdateSkillRequest.php | 749 +++ src/Model/UpdateSlackBotRequest.php | 1198 +++++ src/Model/UpdateTask200Response.php | 2 +- src/Model/UpdateTaskRequest.php | 2 +- src/Model/UploadFile201Response.php | 2 +- src/Model/UploadFileRequest.php | 2 +- .../UploadVectorDocuments200Response.php | 2 +- src/Model/UploadVectorDocumentsRequest.php | 2 +- ...adVectorDocumentsRequestDocumentsInner.php | 44 +- ...DocumentsRequestDocumentsInnerMetadata.php | 2 +- src/Model/UpsertAgentOverlay200Response.php | 409 ++ src/Model/UpsertAgentOverlayRequest.php | 817 +++ src/Model/V1ContentItem.php | 2 +- src/Model/V1ContentListResponse.php | 2 +- src/Model/V1ContentRequest.php | 2 +- src/Model/V1DeleteResponse.php | 2 +- src/Model/V1Error.php | 2 +- src/Model/V1FormSubmissionItem.php | 2 +- src/Model/V1FormSubmissionListResponse.php | 2 +- src/Model/V1GetMetricSeriesResponse.php | 2 +- src/Model/V1GetMetricSeriesResponseData.php | 2 +- src/Model/V1GetMetricsResponse.php | 2 +- src/Model/V1GetMetricsResponseData.php | 2 +- src/Model/V1GlobalMetaResponse.php | 2 +- src/Model/V1GlobalMetaResponseGlobalMeta.php | 2 +- src/Model/V1Info.php | 2 +- src/Model/V1Meta.php | 2 +- src/Model/V1MetricDayStats.php | 2 +- src/Model/V1MetricMinuteStats.php | 2 +- src/Model/V1MetricMonthStats.php | 2 +- src/Model/V1PingResponse.php | 2 +- src/Model/V1ProxyItem.php | 2 +- src/Model/V1ProxyListResponse.php | 2 +- src/Model/V1RedirectItem.php | 2 +- src/Model/V1RedirectListResponse.php | 2 +- src/Model/V1RedirectRequest.php | 2 +- src/Model/V1RedirectResponse.php | 2 +- src/Model/V1Revision.php | 2 +- src/Model/V1RevisionsResponse.php | 2 +- src/Model/V1SearchHit.php | 2 +- src/Model/V1SearchItemsResponse.php | 2 +- src/Model/V1SearchMutationResponse.php | 2 +- src/Model/V1SearchRecord.php | 2 +- src/Model/V1SearchResponse.php | 2 +- src/Model/V1SeriesPointDay.php | 2 +- src/Model/V1SeriesPointMonth.php | 2 +- src/Model/V1Transition.php | 2 +- src/Model/V1UploadResponse.php | 2 +- src/Model/V1UrlMetaRequest.php | 2 +- src/Model/V1UrlMetaResponse.php | 2 +- src/Model/V1WafLogItem.php | 2 +- src/Model/V1WafLogListResponse.php | 2 +- src/Model/V2Crawler.php | 2 +- src/Model/V2CrawlerAssets.php | 2 +- src/Model/V2CrawlerAssetsNetworkIntercept.php | 2 +- src/Model/V2CrawlerAssetsParser.php | 2 +- src/Model/V2CrawlerRequest.php | 2 +- src/Model/V2CrawlerRun.php | 2 +- src/Model/V2CrawlerSchedule.php | 4 +- src/Model/V2CrawlerScheduleRequest.php | 11 +- src/Model/V2CrawlerSitemapInner.php | 2 +- src/Model/V2CustomHeaderRequest.php | 2 +- src/Model/V2Domain.php | 2 +- src/Model/V2DomainDnsGoLiveRecordsInner.php | 2 +- .../V2DomainDnsValidationRecordsInner.php | 2 +- src/Model/V2DomainRequest.php | 2 +- src/Model/V2Error.php | 2 +- src/Model/V2MetricData.php | 523 ++ src/Model/V2MetricDataPoint.php | 449 ++ src/Model/V2MetricDataPointTimestamp.php | 382 ++ src/Model/V2MetricsMeta.php | 673 +++ src/Model/V2MetricsResponse.php | 449 ++ src/Model/V2Organization.php | 2 +- src/Model/V2OrganizationRequest.php | 2 +- src/Model/V2Project.php | 2 +- src/Model/V2ProjectRequest.php | 2 +- src/Model/V2Rule.php | 104 +- src/Model/V2RuleAuth.php | 104 +- src/Model/V2RuleAuthAction.php | 2 +- src/Model/V2RuleAuthRequest.php | 104 +- src/Model/V2RuleBotChallenge.php | 104 +- src/Model/V2RuleBotChallengeAction.php | 2 +- src/Model/V2RuleBotChallengeRequest.php | 104 +- src/Model/V2RuleContentFilter.php | 104 +- src/Model/V2RuleContentFilterAction.php | 2 +- src/Model/V2RuleContentFilterRequest.php | 104 +- src/Model/V2RuleCustomResponse.php | 104 +- src/Model/V2RuleCustomResponseAction.php | 2 +- src/Model/V2RuleCustomResponseRequest.php | 104 +- src/Model/V2RuleFunction.php | 104 +- src/Model/V2RuleFunctionAction.php | 2 +- src/Model/V2RuleFunctionRequest.php | 104 +- src/Model/V2RuleHeader.php | 104 +- src/Model/V2RuleHeaderAction.php | 2 +- src/Model/V2RuleHeaderRequest.php | 104 +- src/Model/V2RuleProxy.php | 104 +- src/Model/V2RuleProxyAction.php | 2 +- src/Model/V2RuleProxyActionNotifyConfig.php | 2 +- .../V2RuleProxyActionQuantCloudSelection.php | 2 +- src/Model/V2RuleProxyRequest.php | 104 +- src/Model/V2RuleRedirect.php | 104 +- src/Model/V2RuleRedirectAction.php | 2 +- src/Model/V2RuleRedirectRequest.php | 104 +- src/Model/V2RuleRequest.php | 116 +- src/Model/V2RuleServeStatic.php | 104 +- src/Model/V2RuleServeStaticAction.php | 2 +- src/Model/V2RuleServeStaticRequest.php | 104 +- src/Model/V2SecretStore.php | 2 +- src/Model/V2SecretStoreRequest.php | 2 +- src/Model/V2Store.php | 2 +- src/Model/V2StoreItem.php | 2 +- src/Model/V2StoreItemRequest.php | 2 +- src/Model/V2StoreItemUpdateRequest.php | 2 +- src/Model/V2StoreItemsListResponse.php | 2 +- src/Model/V2StoreRequest.php | 2 +- src/Model/ValidateCompose200Response.php | 2 +- src/Model/ValidateCompose422Response.php | 2 +- src/Model/ValidateComposeRequest.php | 2 +- src/Model/Variable.php | 2 +- src/Model/Volume.php | 2 +- src/Model/WafConfig.php | 2 +- src/Model/WafConfigBlockLists.php | 2 +- src/Model/WafConfigHttpbl.php | 2 +- src/Model/WafConfigThresholdsInner.php | 2 +- src/ObjectSerializer.php | 2 +- .../ApplicationEnvironmentsInnerTest.php | 123 - ...IUsageStats200ResponseByModelValueTest.php | 100 - test/Model/GetAIUsageStats200ResponseTest.php | 109 - test/Model/ScalingPolicyTest.php | 118 - 654 files changed, 95757 insertions(+), 2032 deletions(-) create mode 100644 docs/Api/AIApi.md create mode 100644 docs/Api/AIFilterPoliciesApi.md create mode 100644 docs/Api/AIGovernanceApi.md create mode 100644 docs/Api/AIOrchestrationsApi.md create mode 100644 docs/Api/AISearchApi.md create mode 100644 docs/Api/AISkillsApi.md create mode 100644 docs/Api/AISlackBotsApi.md rename docs/Api/{AIMonitoringApi.md => AIUsageApi.md} (62%) create mode 100644 docs/Api/CDNMetricsApi.md create mode 100644 docs/Api/OpenAICompatibilityApi.md delete mode 100644 docs/Api/OrchestrationApi.md create mode 100644 docs/Api/RestoreManagementApi.md create mode 100644 docs/Api/SubscriptionApi.md create mode 100644 docs/Api/TokensApi.md create mode 100644 docs/Model/AiSearchChatRequest.md rename docs/Model/{GetAIUsageStats200ResponseByModelValue.md => AiSearchDeletePagesRequest.md} (57%) create mode 100644 docs/Model/AiSearchEnableRequest.md create mode 100644 docs/Model/AiSearchIngestPagesRequest.md create mode 100644 docs/Model/AiSearchIngestPagesRequestPagesInner.md create mode 100644 docs/Model/AiSearchSearchRequest.md create mode 100644 docs/Model/AiSearchTriggerCrawlRequest.md create mode 100644 docs/Model/AiSearchUpdateSettingsRequest.md create mode 100644 docs/Model/ApplicationCache.md delete mode 100644 docs/Model/ApplicationEnvironmentsInner.md create mode 100644 docs/Model/ChatInferenceRequestGuardrails.md create mode 100644 docs/Model/CreateFilterPolicyRequest.md create mode 100644 docs/Model/CreateFilterPolicyRequestRulesInner.md create mode 100644 docs/Model/CreateFilterPolicyRequestRulesInnerMatch.md create mode 100644 docs/Model/CreateOrchestrationRequest.md create mode 100644 docs/Model/CreateOrchestrationRequestInputSource.md create mode 100644 docs/Model/CreateOrchestrationRequestStopCondition.md create mode 100644 docs/Model/CreateSkill201Response.md create mode 100644 docs/Model/CreateSkillRequest.md create mode 100644 docs/Model/CreateSlackBot201Response.md create mode 100644 docs/Model/CreateSlackBotRequest.md rename docs/Model/{DeleteVectorCollection200Response.md => DeleteAgentOverlay200Response.md} (89%) create mode 100644 docs/Model/DeleteSkill200Response.md create mode 100644 docs/Model/DeleteSkillCollection200Response.md create mode 100644 docs/Model/DeleteSlackBot200Response.md create mode 100644 docs/Model/DeleteVectorDocuments200Response.md create mode 100644 docs/Model/DeleteVectorDocumentsRequest.md create mode 100644 docs/Model/DeleteVectorDocumentsRequestMetadata.md delete mode 100644 docs/Model/GetAIUsageStats200Response.md create mode 100644 docs/Model/GetAgentOverlay200Response.md create mode 100644 docs/Model/GetAgentOverlay200ResponseBase.md create mode 100644 docs/Model/GetAgentOverlay200ResponseOverlay.md create mode 100644 docs/Model/GetCustomTool200Response.md create mode 100644 docs/Model/GetCustomTool200ResponseTool.md create mode 100644 docs/Model/GetGovernanceConfig200Response.md create mode 100644 docs/Model/GetGovernanceConfig200ResponseSpendLimits.md create mode 100644 docs/Model/GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue.md create mode 100644 docs/Model/GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue.md create mode 100644 docs/Model/GetGovernanceSpend200Response.md create mode 100644 docs/Model/GetGovernanceSpend200ResponseBudget.md create mode 100644 docs/Model/GetGovernanceSpend200ResponseDailyBudget.md create mode 100644 docs/Model/GetGovernanceSpend200ResponseOrgTotal.md create mode 100644 docs/Model/GetGovernanceSpend200ResponseTodayTotal.md create mode 100644 docs/Model/GetGovernanceSpend200ResponseUserTotal.md create mode 100644 docs/Model/GetMyUsage200Response.md create mode 100644 docs/Model/GetMyUsage200ResponseDaily.md create mode 100644 docs/Model/GetMyUsage200ResponseMonthly.md create mode 100644 docs/Model/GetMyUsage200ResponseQuota.md create mode 100644 docs/Model/GetMyUsage200ResponseQuotaDailyLimit.md create mode 100644 docs/Model/GetMyUsage200ResponseQuotaMonthlyLimit.md create mode 100644 docs/Model/GetRestoreStatus200Response.md rename docs/Model/{ScalingPolicy.md => GetScalingPolicyResponse.md} (64%) create mode 100644 docs/Model/GetSkill200Response.md create mode 100644 docs/Model/GetSkill200ResponseSkill.md create mode 100644 docs/Model/GetSlackBot200Response.md create mode 100644 docs/Model/GetSlackBot200ResponseBot.md create mode 100644 docs/Model/ImportSkill201Response.md create mode 100644 docs/Model/ImportSkillCollection201Response.md create mode 100644 docs/Model/ImportSkillCollectionRequest.md create mode 100644 docs/Model/ImportSkillCollectionRequestSource.md create mode 100644 docs/Model/ImportSkillRequest.md create mode 100644 docs/Model/ImportSkillRequestSource.md create mode 100644 docs/Model/KVLinkToProject200Response.md create mode 100644 docs/Model/KVLinkToProjectRequest.md create mode 100644 docs/Model/ListOrchestrationBatches200Response.md create mode 100644 docs/Model/ListOrchestrationBatches200ResponseBatchesInner.md create mode 100644 docs/Model/ListOrchestrations200Response.md create mode 100644 docs/Model/ListSkillCollections200Response.md create mode 100644 docs/Model/ListSkillCollections200ResponseCollectionsInner.md create mode 100644 docs/Model/ListSkills200Response.md create mode 100644 docs/Model/ListSkills200ResponseSkillsInner.md create mode 100644 docs/Model/ListSlackBots200Response.md create mode 100644 docs/Model/ListSlackBots200ResponseBotsInner.md create mode 100644 docs/Model/OaiChatCompletions200Response.md create mode 100644 docs/Model/OaiChatCompletions200ResponseChoicesInner.md create mode 100644 docs/Model/OaiChatCompletions200ResponseChoicesInnerMessage.md create mode 100644 docs/Model/OaiChatCompletions200ResponseUsage.md create mode 100644 docs/Model/OaiChatCompletionsRequest.md create mode 100644 docs/Model/OaiChatCompletionsRequestMessagesInner.md create mode 100644 docs/Model/OaiEmbeddings200Response.md create mode 100644 docs/Model/OaiEmbeddings200ResponseDataInner.md create mode 100644 docs/Model/OaiEmbeddings200ResponseUsage.md create mode 100644 docs/Model/OaiEmbeddingsRequest.md create mode 100644 docs/Model/OaiGetModel200Response.md create mode 100644 docs/Model/OaiListModels200Response.md create mode 100644 docs/Model/OaiListModels200ResponseDataInner.md create mode 100644 docs/Model/RestoreDatabase202Response.md create mode 100644 docs/Model/RestoreDatabaseRequest.md create mode 100644 docs/Model/RestoreFilesystem202Response.md create mode 100644 docs/Model/RestoreFilesystemRequest.md create mode 100644 docs/Model/ScalingPolicyListResponse.md create mode 100644 docs/Model/SearchSlackWorkspaceChannels200Response.md create mode 100644 docs/Model/SearchSlackWorkspaceChannels200ResponseResultsInner.md create mode 100644 docs/Model/SearchSlackWorkspaceUsers200Response.md create mode 100644 docs/Model/SearchSlackWorkspaceUsers200ResponseResultsInner.md create mode 100644 docs/Model/SetScalingPolicyRequest.md create mode 100644 docs/Model/SyncSkillCollection200Response.md create mode 100644 docs/Model/TokensCreate201Response.md create mode 100644 docs/Model/TokensCreateRequest.md create mode 100644 docs/Model/TokensDelete200Response.md create mode 100644 docs/Model/TokensList200ResponseInner.md create mode 100644 docs/Model/UpdateFilterPolicyRequest.md create mode 100644 docs/Model/UpdateGovernanceConfig200Response.md create mode 100644 docs/Model/UpdateGovernanceConfigRequest.md create mode 100644 docs/Model/UpdateSkill200Response.md create mode 100644 docs/Model/UpdateSkillRequest.md create mode 100644 docs/Model/UpdateSlackBotRequest.md create mode 100644 docs/Model/UpsertAgentOverlay200Response.md create mode 100644 docs/Model/UpsertAgentOverlayRequest.md create mode 100644 docs/Model/V2MetricData.md create mode 100644 docs/Model/V2MetricDataPoint.md create mode 100644 docs/Model/V2MetricDataPointTimestamp.md create mode 100644 docs/Model/V2MetricsMeta.md create mode 100644 docs/Model/V2MetricsResponse.md rename src/Api/{OrchestrationApi.php => AIApi.php} (59%) create mode 100644 src/Api/AIFilterPoliciesApi.php create mode 100644 src/Api/AIGovernanceApi.php create mode 100644 src/Api/AIOrchestrationsApi.php create mode 100644 src/Api/AISearchApi.php create mode 100644 src/Api/AISkillsApi.php create mode 100644 src/Api/AISlackBotsApi.php rename src/Api/{AIMonitoringApi.php => AIUsageApi.php} (79%) create mode 100644 src/Api/CDNMetricsApi.php create mode 100644 src/Api/OpenAICompatibilityApi.php create mode 100644 src/Api/RestoreManagementApi.php create mode 100644 src/Api/SubscriptionApi.php create mode 100644 src/Api/TokensApi.php create mode 100644 src/Model/AiSearchChatRequest.php create mode 100644 src/Model/AiSearchDeletePagesRequest.php create mode 100644 src/Model/AiSearchEnableRequest.php create mode 100644 src/Model/AiSearchIngestPagesRequest.php create mode 100644 src/Model/AiSearchIngestPagesRequestPagesInner.php create mode 100644 src/Model/AiSearchSearchRequest.php create mode 100644 src/Model/AiSearchTriggerCrawlRequest.php create mode 100644 src/Model/AiSearchUpdateSettingsRequest.php create mode 100644 src/Model/ApplicationCache.php create mode 100644 src/Model/ChatInferenceRequestGuardrails.php create mode 100644 src/Model/CreateFilterPolicyRequest.php create mode 100644 src/Model/CreateFilterPolicyRequestRulesInner.php create mode 100644 src/Model/CreateFilterPolicyRequestRulesInnerMatch.php create mode 100644 src/Model/CreateOrchestrationRequest.php create mode 100644 src/Model/CreateOrchestrationRequestInputSource.php create mode 100644 src/Model/CreateOrchestrationRequestStopCondition.php create mode 100644 src/Model/CreateSkill201Response.php create mode 100644 src/Model/CreateSkillRequest.php create mode 100644 src/Model/CreateSlackBot201Response.php create mode 100644 src/Model/CreateSlackBotRequest.php rename src/Model/{DeleteVectorCollection200Response.php => DeleteAgentOverlay200Response.php} (96%) create mode 100644 src/Model/DeleteSkill200Response.php create mode 100644 src/Model/DeleteSkillCollection200Response.php create mode 100644 src/Model/DeleteSlackBot200Response.php create mode 100644 src/Model/DeleteVectorDocuments200Response.php create mode 100644 src/Model/DeleteVectorDocumentsRequest.php create mode 100644 src/Model/DeleteVectorDocumentsRequestMetadata.php create mode 100644 src/Model/GetAgentOverlay200Response.php create mode 100644 src/Model/GetAgentOverlay200ResponseBase.php create mode 100644 src/Model/GetAgentOverlay200ResponseOverlay.php create mode 100644 src/Model/GetCustomTool200Response.php create mode 100644 src/Model/GetCustomTool200ResponseTool.php create mode 100644 src/Model/GetGovernanceConfig200Response.php create mode 100644 src/Model/GetGovernanceConfig200ResponseSpendLimits.php create mode 100644 src/Model/GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue.php create mode 100644 src/Model/GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue.php create mode 100644 src/Model/GetGovernanceSpend200Response.php create mode 100644 src/Model/GetGovernanceSpend200ResponseBudget.php create mode 100644 src/Model/GetGovernanceSpend200ResponseDailyBudget.php create mode 100644 src/Model/GetGovernanceSpend200ResponseOrgTotal.php create mode 100644 src/Model/GetGovernanceSpend200ResponseTodayTotal.php create mode 100644 src/Model/GetGovernanceSpend200ResponseUserTotal.php create mode 100644 src/Model/GetMyUsage200Response.php create mode 100644 src/Model/GetMyUsage200ResponseDaily.php create mode 100644 src/Model/GetMyUsage200ResponseMonthly.php create mode 100644 src/Model/GetMyUsage200ResponseQuota.php create mode 100644 src/Model/GetMyUsage200ResponseQuotaDailyLimit.php create mode 100644 src/Model/GetMyUsage200ResponseQuotaMonthlyLimit.php create mode 100644 src/Model/GetRestoreStatus200Response.php create mode 100644 src/Model/GetScalingPolicyResponse.php create mode 100644 src/Model/GetSkill200Response.php create mode 100644 src/Model/GetSkill200ResponseSkill.php create mode 100644 src/Model/GetSlackBot200Response.php create mode 100644 src/Model/GetSlackBot200ResponseBot.php create mode 100644 src/Model/ImportSkill201Response.php create mode 100644 src/Model/ImportSkillCollection201Response.php create mode 100644 src/Model/ImportSkillCollectionRequest.php create mode 100644 src/Model/ImportSkillCollectionRequestSource.php create mode 100644 src/Model/ImportSkillRequest.php create mode 100644 src/Model/ImportSkillRequestSource.php create mode 100644 src/Model/KVLinkToProject200Response.php create mode 100644 src/Model/KVLinkToProjectRequest.php create mode 100644 src/Model/ListOrchestrationBatches200Response.php create mode 100644 src/Model/ListOrchestrationBatches200ResponseBatchesInner.php create mode 100644 src/Model/ListOrchestrations200Response.php create mode 100644 src/Model/ListSkillCollections200Response.php create mode 100644 src/Model/ListSkillCollections200ResponseCollectionsInner.php rename src/Model/{GetAIUsageStats200ResponseByModelValue.php => ListSkills200Response.php} (84%) create mode 100644 src/Model/ListSkills200ResponseSkillsInner.php create mode 100644 src/Model/ListSlackBots200Response.php create mode 100644 src/Model/ListSlackBots200ResponseBotsInner.php create mode 100644 src/Model/OaiChatCompletions200Response.php create mode 100644 src/Model/OaiChatCompletions200ResponseChoicesInner.php create mode 100644 src/Model/OaiChatCompletions200ResponseChoicesInnerMessage.php rename src/Model/{GetAIUsageStats200Response.php => OaiChatCompletions200ResponseUsage.php} (80%) create mode 100644 src/Model/OaiChatCompletionsRequest.php create mode 100644 src/Model/OaiChatCompletionsRequestMessagesInner.php create mode 100644 src/Model/OaiEmbeddings200Response.php create mode 100644 src/Model/OaiEmbeddings200ResponseDataInner.php create mode 100644 src/Model/OaiEmbeddings200ResponseUsage.php create mode 100644 src/Model/OaiEmbeddingsRequest.php create mode 100644 src/Model/OaiGetModel200Response.php create mode 100644 src/Model/OaiListModels200Response.php create mode 100644 src/Model/OaiListModels200ResponseDataInner.php create mode 100644 src/Model/RestoreDatabase202Response.php create mode 100644 src/Model/RestoreDatabaseRequest.php rename src/Model/{ApplicationEnvironmentsInner.php => RestoreFilesystem202Response.php} (78%) create mode 100644 src/Model/RestoreFilesystemRequest.php create mode 100644 src/Model/ScalingPolicyListResponse.php create mode 100644 src/Model/SearchSlackWorkspaceChannels200Response.php create mode 100644 src/Model/SearchSlackWorkspaceChannels200ResponseResultsInner.php create mode 100644 src/Model/SearchSlackWorkspaceUsers200Response.php create mode 100644 src/Model/SearchSlackWorkspaceUsers200ResponseResultsInner.php rename src/Model/{ScalingPolicy.php => SetScalingPolicyRequest.php} (92%) create mode 100644 src/Model/SyncSkillCollection200Response.php create mode 100644 src/Model/TokensCreate201Response.php create mode 100644 src/Model/TokensCreateRequest.php create mode 100644 src/Model/TokensDelete200Response.php create mode 100644 src/Model/TokensList200ResponseInner.php create mode 100644 src/Model/UpdateFilterPolicyRequest.php create mode 100644 src/Model/UpdateGovernanceConfig200Response.php create mode 100644 src/Model/UpdateGovernanceConfigRequest.php create mode 100644 src/Model/UpdateSkill200Response.php create mode 100644 src/Model/UpdateSkillRequest.php create mode 100644 src/Model/UpdateSlackBotRequest.php create mode 100644 src/Model/UpsertAgentOverlay200Response.php create mode 100644 src/Model/UpsertAgentOverlayRequest.php create mode 100644 src/Model/V2MetricData.php create mode 100644 src/Model/V2MetricDataPoint.php create mode 100644 src/Model/V2MetricDataPointTimestamp.php create mode 100644 src/Model/V2MetricsMeta.php create mode 100644 src/Model/V2MetricsResponse.php delete mode 100644 test/Model/ApplicationEnvironmentsInnerTest.php delete mode 100644 test/Model/GetAIUsageStats200ResponseByModelValueTest.php delete mode 100644 test/Model/GetAIUsageStats200ResponseTest.php delete mode 100644 test/Model/ScalingPolicyTest.php diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index c2443d17..543fd552 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -3,17 +3,25 @@ .travis.yml README.md docs/Api/AIAgentsApi.md +docs/Api/AIApi.md docs/Api/AICustomToolsApi.md docs/Api/AIFileStorageApi.md +docs/Api/AIFilterPoliciesApi.md +docs/Api/AIGovernanceApi.md docs/Api/AIInferenceApi.md docs/Api/AIModelsApi.md -docs/Api/AIMonitoringApi.md +docs/Api/AIOrchestrationsApi.md +docs/Api/AISearchApi.md docs/Api/AISessionsApi.md +docs/Api/AISkillsApi.md +docs/Api/AISlackBotsApi.md docs/Api/AITaskManagementApi.md docs/Api/AIToolsApi.md +docs/Api/AIUsageApi.md docs/Api/AIVectorDatabaseApi.md docs/Api/ApplicationsApi.md docs/Api/BackupManagementApi.md +docs/Api/CDNMetricsApi.md docs/Api/CommandsApi.md docs/Api/ComposeApi.md docs/Api/ContainersApi.md @@ -24,19 +32,30 @@ docs/Api/DomainsApi.md docs/Api/EnvironmentsApi.md docs/Api/HeadersApi.md docs/Api/KVApi.md -docs/Api/OrchestrationApi.md +docs/Api/OpenAICompatibilityApi.md docs/Api/OrganizationsApi.md docs/Api/ProjectsApi.md docs/Api/PurgeApi.md +docs/Api/RestoreManagementApi.md docs/Api/RulesApi.md docs/Api/SSHAccessApi.md docs/Api/ScalingPolicyApi.md +docs/Api/SubscriptionApi.md +docs/Api/TokensApi.md docs/Api/VariablesApi.md docs/Api/VolumesApi.md +docs/Model/AiSearchChatRequest.md +docs/Model/AiSearchDeletePagesRequest.md +docs/Model/AiSearchEnableRequest.md +docs/Model/AiSearchIngestPagesRequest.md +docs/Model/AiSearchIngestPagesRequestPagesInner.md +docs/Model/AiSearchSearchRequest.md +docs/Model/AiSearchTriggerCrawlRequest.md +docs/Model/AiSearchUpdateSettingsRequest.md docs/Model/Application.md +docs/Model/ApplicationCache.md docs/Model/ApplicationDatabase.md docs/Model/ApplicationDeploymentInformationInner.md -docs/Model/ApplicationEnvironmentsInner.md docs/Model/ApplicationFilesystem.md docs/Model/ApplicationImageReference.md docs/Model/BulkSetEnvironmentVariablesRequest.md @@ -50,6 +69,7 @@ docs/Model/ChatInference200ResponseResponseToolUseOneOfResult.md docs/Model/ChatInference200ResponseUsage.md docs/Model/ChatInference202Response.md docs/Model/ChatInferenceRequest.md +docs/Model/ChatInferenceRequestGuardrails.md docs/Model/ChatInferenceRequestMessagesInner.md docs/Model/ChatInferenceRequestMessagesInnerContent.md docs/Model/ChatInferenceRequestMessagesInnerContentOneOfInner.md @@ -107,6 +127,16 @@ docs/Model/CreateCustomToolRequest.md docs/Model/CreateEnvironment403Response.md docs/Model/CreateEnvironmentRequest.md docs/Model/CreateEnvironmentRequestEnvironmentInner.md +docs/Model/CreateFilterPolicyRequest.md +docs/Model/CreateFilterPolicyRequestRulesInner.md +docs/Model/CreateFilterPolicyRequestRulesInnerMatch.md +docs/Model/CreateOrchestrationRequest.md +docs/Model/CreateOrchestrationRequestInputSource.md +docs/Model/CreateOrchestrationRequestStopCondition.md +docs/Model/CreateSkill201Response.md +docs/Model/CreateSkillRequest.md +docs/Model/CreateSlackBot201Response.md +docs/Model/CreateSlackBotRequest.md docs/Model/CreateTask201Response.md docs/Model/CreateTaskRequest.md docs/Model/CreateVectorCollection201Response.md @@ -117,12 +147,18 @@ docs/Model/Cron.md docs/Model/CronRun.md docs/Model/DeleteAIAgent200Response.md docs/Model/DeleteAISession200Response.md +docs/Model/DeleteAgentOverlay200Response.md docs/Model/DeleteBackup200Response.md docs/Model/DeleteCustomTool200Response.md docs/Model/DeleteFile200Response.md +docs/Model/DeleteSkill200Response.md +docs/Model/DeleteSkillCollection200Response.md +docs/Model/DeleteSlackBot200Response.md docs/Model/DeleteTask200Response.md docs/Model/DeleteTask409Response.md -docs/Model/DeleteVectorCollection200Response.md +docs/Model/DeleteVectorDocuments200Response.md +docs/Model/DeleteVectorDocumentsRequest.md +docs/Model/DeleteVectorDocumentsRequestMetadata.md docs/Model/DownloadBackup200Response.md docs/Model/Embeddings200Response.md docs/Model/Embeddings200ResponseEmbeddings.md @@ -147,8 +183,11 @@ docs/Model/GetAISession200Response.md docs/Model/GetAIToolExecutionStatus200Response.md docs/Model/GetAIToolExecutionStatus200ResponseResult.md docs/Model/GetAIToolExecutionStatus404Response.md -docs/Model/GetAIUsageStats200Response.md -docs/Model/GetAIUsageStats200ResponseByModelValue.md +docs/Model/GetAgentOverlay200Response.md +docs/Model/GetAgentOverlay200ResponseBase.md +docs/Model/GetAgentOverlay200ResponseOverlay.md +docs/Model/GetCustomTool200Response.md +docs/Model/GetCustomTool200ResponseTool.md docs/Model/GetDependencyGraph200Response.md docs/Model/GetDurableExecutionStatus200Response.md docs/Model/GetDurableExecutionStatus200ResponseError.md @@ -160,6 +199,28 @@ docs/Model/GetEcrLoginCredentials200Response.md docs/Model/GetEnvironmentLogs200Response.md docs/Model/GetEnvironmentLogs200ResponseLogEventsInner.md docs/Model/GetFile200Response.md +docs/Model/GetGovernanceConfig200Response.md +docs/Model/GetGovernanceConfig200ResponseSpendLimits.md +docs/Model/GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue.md +docs/Model/GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue.md +docs/Model/GetGovernanceSpend200Response.md +docs/Model/GetGovernanceSpend200ResponseBudget.md +docs/Model/GetGovernanceSpend200ResponseDailyBudget.md +docs/Model/GetGovernanceSpend200ResponseOrgTotal.md +docs/Model/GetGovernanceSpend200ResponseTodayTotal.md +docs/Model/GetGovernanceSpend200ResponseUserTotal.md +docs/Model/GetMyUsage200Response.md +docs/Model/GetMyUsage200ResponseDaily.md +docs/Model/GetMyUsage200ResponseMonthly.md +docs/Model/GetMyUsage200ResponseQuota.md +docs/Model/GetMyUsage200ResponseQuotaDailyLimit.md +docs/Model/GetMyUsage200ResponseQuotaMonthlyLimit.md +docs/Model/GetRestoreStatus200Response.md +docs/Model/GetScalingPolicyResponse.md +docs/Model/GetSkill200Response.md +docs/Model/GetSkill200ResponseSkill.md +docs/Model/GetSlackBot200Response.md +docs/Model/GetSlackBot200ResponseBot.md docs/Model/GetSshAccessCredentials200Response.md docs/Model/GetSshAccessCredentials200ResponseCredentials.md docs/Model/GetTask200Response.md @@ -174,10 +235,18 @@ docs/Model/ImageGenerationRequestImageVariationParams.md docs/Model/ImageGenerationRequestInPaintingParams.md docs/Model/ImageGenerationRequestOutPaintingParams.md docs/Model/ImageGenerationRequestTextToImageParams.md +docs/Model/ImportSkill201Response.md +docs/Model/ImportSkillCollection201Response.md +docs/Model/ImportSkillCollectionRequest.md +docs/Model/ImportSkillCollectionRequestSource.md +docs/Model/ImportSkillRequest.md +docs/Model/ImportSkillRequestSource.md docs/Model/KVItemsCreate200Response.md docs/Model/KVItemsDelete200Response.md docs/Model/KVItemsShow200Response.md docs/Model/KVItemsShow200ResponseValue.md +docs/Model/KVLinkToProject200Response.md +docs/Model/KVLinkToProjectRequest.md docs/Model/ListAIAgents200Response.md docs/Model/ListAIAgents200ResponseAgentsInner.md docs/Model/ListAIModels200Response.md @@ -198,10 +267,32 @@ docs/Model/ListCustomTools200Response.md docs/Model/ListCustomTools200ResponseToolsInner.md docs/Model/ListFiles200Response.md docs/Model/ListFiles200ResponseFilesInner.md +docs/Model/ListOrchestrationBatches200Response.md +docs/Model/ListOrchestrationBatches200ResponseBatchesInner.md +docs/Model/ListOrchestrations200Response.md +docs/Model/ListSkillCollections200Response.md +docs/Model/ListSkillCollections200ResponseCollectionsInner.md +docs/Model/ListSkills200Response.md +docs/Model/ListSkills200ResponseSkillsInner.md +docs/Model/ListSlackBots200Response.md +docs/Model/ListSlackBots200ResponseBotsInner.md docs/Model/ListTasks200Response.md docs/Model/ListTasks200ResponseTasksInner.md docs/Model/ListVectorCollections200Response.md docs/Model/ListVectorCollections200ResponseCollectionsInner.md +docs/Model/OaiChatCompletions200Response.md +docs/Model/OaiChatCompletions200ResponseChoicesInner.md +docs/Model/OaiChatCompletions200ResponseChoicesInnerMessage.md +docs/Model/OaiChatCompletions200ResponseUsage.md +docs/Model/OaiChatCompletionsRequest.md +docs/Model/OaiChatCompletionsRequestMessagesInner.md +docs/Model/OaiEmbeddings200Response.md +docs/Model/OaiEmbeddings200ResponseDataInner.md +docs/Model/OaiEmbeddings200ResponseUsage.md +docs/Model/OaiEmbeddingsRequest.md +docs/Model/OaiGetModel200Response.md +docs/Model/OaiListModels200Response.md +docs/Model/OaiListModels200ResponseDataInner.md docs/Model/OrganizationsList200ResponseInner.md docs/Model/PatchEnvironmentCompose202Response.md docs/Model/PatchEnvironmentCompose202ResponseSpotConfiguration.md @@ -214,13 +305,27 @@ docs/Model/QueryVectorCollection200ResponsePagination.md docs/Model/QueryVectorCollection200ResponseResultsInner.md docs/Model/QueryVectorCollectionRequest.md docs/Model/QueryVectorCollectionRequestFilter.md -docs/Model/ScalingPolicy.md +docs/Model/RestoreDatabase202Response.md +docs/Model/RestoreDatabaseRequest.md +docs/Model/RestoreFilesystem202Response.md +docs/Model/RestoreFilesystemRequest.md +docs/Model/ScalingPolicyListResponse.md +docs/Model/SearchSlackWorkspaceChannels200Response.md +docs/Model/SearchSlackWorkspaceChannels200ResponseResultsInner.md +docs/Model/SearchSlackWorkspaceUsers200Response.md +docs/Model/SearchSlackWorkspaceUsers200ResponseResultsInner.md +docs/Model/SetScalingPolicyRequest.md docs/Model/SpotConfiguration.md docs/Model/SubmitToolCallback200Response.md docs/Model/SubmitToolCallbackRequest.md docs/Model/SubmitToolCallbackRequestToolResultsInner.md docs/Model/SyncOperation.md +docs/Model/SyncSkillCollection200Response.md docs/Model/SyncToEnvironmentRequest.md +docs/Model/TokensCreate201Response.md +docs/Model/TokensCreateRequest.md +docs/Model/TokensDelete200Response.md +docs/Model/TokensList200ResponseInner.md docs/Model/UpdateAIAgent200Response.md docs/Model/UpdateAIAgentRequest.md docs/Model/UpdateAISession200Response.md @@ -230,6 +335,12 @@ docs/Model/UpdateCronJobRequest.md docs/Model/UpdateEnvironmentRequest.md docs/Model/UpdateEnvironmentStateRequest.md docs/Model/UpdateEnvironmentVariableRequest.md +docs/Model/UpdateFilterPolicyRequest.md +docs/Model/UpdateGovernanceConfig200Response.md +docs/Model/UpdateGovernanceConfigRequest.md +docs/Model/UpdateSkill200Response.md +docs/Model/UpdateSkillRequest.md +docs/Model/UpdateSlackBotRequest.md docs/Model/UpdateTask200Response.md docs/Model/UpdateTaskRequest.md docs/Model/UploadFile201Response.md @@ -238,6 +349,8 @@ docs/Model/UploadVectorDocuments200Response.md docs/Model/UploadVectorDocumentsRequest.md docs/Model/UploadVectorDocumentsRequestDocumentsInner.md docs/Model/UploadVectorDocumentsRequestDocumentsInnerMetadata.md +docs/Model/UpsertAgentOverlay200Response.md +docs/Model/UpsertAgentOverlayRequest.md docs/Model/V1ContentItem.md docs/Model/V1ContentListResponse.md docs/Model/V1ContentRequest.md @@ -293,6 +406,11 @@ docs/Model/V2DomainDnsGoLiveRecordsInner.md docs/Model/V2DomainDnsValidationRecordsInner.md docs/Model/V2DomainRequest.md docs/Model/V2Error.md +docs/Model/V2MetricData.md +docs/Model/V2MetricDataPoint.md +docs/Model/V2MetricDataPointTimestamp.md +docs/Model/V2MetricsMeta.md +docs/Model/V2MetricsResponse.md docs/Model/V2Organization.md docs/Model/V2OrganizationRequest.md docs/Model/V2Project.md @@ -348,17 +466,25 @@ docs/Model/WafConfigThresholdsInner.md git_push.sh phpunit.xml.dist src/Api/AIAgentsApi.php +src/Api/AIApi.php src/Api/AICustomToolsApi.php src/Api/AIFileStorageApi.php +src/Api/AIFilterPoliciesApi.php +src/Api/AIGovernanceApi.php src/Api/AIInferenceApi.php src/Api/AIModelsApi.php -src/Api/AIMonitoringApi.php +src/Api/AIOrchestrationsApi.php +src/Api/AISearchApi.php src/Api/AISessionsApi.php +src/Api/AISkillsApi.php +src/Api/AISlackBotsApi.php src/Api/AITaskManagementApi.php src/Api/AIToolsApi.php +src/Api/AIUsageApi.php src/Api/AIVectorDatabaseApi.php src/Api/ApplicationsApi.php src/Api/BackupManagementApi.php +src/Api/CDNMetricsApi.php src/Api/CommandsApi.php src/Api/ComposeApi.php src/Api/ContainersApi.php @@ -369,23 +495,34 @@ src/Api/DomainsApi.php src/Api/EnvironmentsApi.php src/Api/HeadersApi.php src/Api/KVApi.php -src/Api/OrchestrationApi.php +src/Api/OpenAICompatibilityApi.php src/Api/OrganizationsApi.php src/Api/ProjectsApi.php src/Api/PurgeApi.php +src/Api/RestoreManagementApi.php src/Api/RulesApi.php src/Api/SSHAccessApi.php src/Api/ScalingPolicyApi.php +src/Api/SubscriptionApi.php +src/Api/TokensApi.php src/Api/VariablesApi.php src/Api/VolumesApi.php src/ApiException.php src/Configuration.php src/FormDataProcessor.php src/HeaderSelector.php +src/Model/AiSearchChatRequest.php +src/Model/AiSearchDeletePagesRequest.php +src/Model/AiSearchEnableRequest.php +src/Model/AiSearchIngestPagesRequest.php +src/Model/AiSearchIngestPagesRequestPagesInner.php +src/Model/AiSearchSearchRequest.php +src/Model/AiSearchTriggerCrawlRequest.php +src/Model/AiSearchUpdateSettingsRequest.php src/Model/Application.php +src/Model/ApplicationCache.php src/Model/ApplicationDatabase.php src/Model/ApplicationDeploymentInformationInner.php -src/Model/ApplicationEnvironmentsInner.php src/Model/ApplicationFilesystem.php src/Model/ApplicationImageReference.php src/Model/BulkSetEnvironmentVariablesRequest.php @@ -399,6 +536,7 @@ src/Model/ChatInference200ResponseResponseToolUseOneOfResult.php src/Model/ChatInference200ResponseUsage.php src/Model/ChatInference202Response.php src/Model/ChatInferenceRequest.php +src/Model/ChatInferenceRequestGuardrails.php src/Model/ChatInferenceRequestMessagesInner.php src/Model/ChatInferenceRequestMessagesInnerContent.php src/Model/ChatInferenceRequestMessagesInnerContentOneOfInner.php @@ -456,6 +594,16 @@ src/Model/CreateCustomToolRequest.php src/Model/CreateEnvironment403Response.php src/Model/CreateEnvironmentRequest.php src/Model/CreateEnvironmentRequestEnvironmentInner.php +src/Model/CreateFilterPolicyRequest.php +src/Model/CreateFilterPolicyRequestRulesInner.php +src/Model/CreateFilterPolicyRequestRulesInnerMatch.php +src/Model/CreateOrchestrationRequest.php +src/Model/CreateOrchestrationRequestInputSource.php +src/Model/CreateOrchestrationRequestStopCondition.php +src/Model/CreateSkill201Response.php +src/Model/CreateSkillRequest.php +src/Model/CreateSlackBot201Response.php +src/Model/CreateSlackBotRequest.php src/Model/CreateTask201Response.php src/Model/CreateTaskRequest.php src/Model/CreateVectorCollection201Response.php @@ -466,12 +614,18 @@ src/Model/Cron.php src/Model/CronRun.php src/Model/DeleteAIAgent200Response.php src/Model/DeleteAISession200Response.php +src/Model/DeleteAgentOverlay200Response.php src/Model/DeleteBackup200Response.php src/Model/DeleteCustomTool200Response.php src/Model/DeleteFile200Response.php +src/Model/DeleteSkill200Response.php +src/Model/DeleteSkillCollection200Response.php +src/Model/DeleteSlackBot200Response.php src/Model/DeleteTask200Response.php src/Model/DeleteTask409Response.php -src/Model/DeleteVectorCollection200Response.php +src/Model/DeleteVectorDocuments200Response.php +src/Model/DeleteVectorDocumentsRequest.php +src/Model/DeleteVectorDocumentsRequestMetadata.php src/Model/DownloadBackup200Response.php src/Model/Embeddings200Response.php src/Model/Embeddings200ResponseEmbeddings.php @@ -496,8 +650,11 @@ src/Model/GetAISession200Response.php src/Model/GetAIToolExecutionStatus200Response.php src/Model/GetAIToolExecutionStatus200ResponseResult.php src/Model/GetAIToolExecutionStatus404Response.php -src/Model/GetAIUsageStats200Response.php -src/Model/GetAIUsageStats200ResponseByModelValue.php +src/Model/GetAgentOverlay200Response.php +src/Model/GetAgentOverlay200ResponseBase.php +src/Model/GetAgentOverlay200ResponseOverlay.php +src/Model/GetCustomTool200Response.php +src/Model/GetCustomTool200ResponseTool.php src/Model/GetDependencyGraph200Response.php src/Model/GetDurableExecutionStatus200Response.php src/Model/GetDurableExecutionStatus200ResponseError.php @@ -509,6 +666,28 @@ src/Model/GetEcrLoginCredentials200Response.php src/Model/GetEnvironmentLogs200Response.php src/Model/GetEnvironmentLogs200ResponseLogEventsInner.php src/Model/GetFile200Response.php +src/Model/GetGovernanceConfig200Response.php +src/Model/GetGovernanceConfig200ResponseSpendLimits.php +src/Model/GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue.php +src/Model/GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue.php +src/Model/GetGovernanceSpend200Response.php +src/Model/GetGovernanceSpend200ResponseBudget.php +src/Model/GetGovernanceSpend200ResponseDailyBudget.php +src/Model/GetGovernanceSpend200ResponseOrgTotal.php +src/Model/GetGovernanceSpend200ResponseTodayTotal.php +src/Model/GetGovernanceSpend200ResponseUserTotal.php +src/Model/GetMyUsage200Response.php +src/Model/GetMyUsage200ResponseDaily.php +src/Model/GetMyUsage200ResponseMonthly.php +src/Model/GetMyUsage200ResponseQuota.php +src/Model/GetMyUsage200ResponseQuotaDailyLimit.php +src/Model/GetMyUsage200ResponseQuotaMonthlyLimit.php +src/Model/GetRestoreStatus200Response.php +src/Model/GetScalingPolicyResponse.php +src/Model/GetSkill200Response.php +src/Model/GetSkill200ResponseSkill.php +src/Model/GetSlackBot200Response.php +src/Model/GetSlackBot200ResponseBot.php src/Model/GetSshAccessCredentials200Response.php src/Model/GetSshAccessCredentials200ResponseCredentials.php src/Model/GetTask200Response.php @@ -523,10 +702,18 @@ src/Model/ImageGenerationRequestImageVariationParams.php src/Model/ImageGenerationRequestInPaintingParams.php src/Model/ImageGenerationRequestOutPaintingParams.php src/Model/ImageGenerationRequestTextToImageParams.php +src/Model/ImportSkill201Response.php +src/Model/ImportSkillCollection201Response.php +src/Model/ImportSkillCollectionRequest.php +src/Model/ImportSkillCollectionRequestSource.php +src/Model/ImportSkillRequest.php +src/Model/ImportSkillRequestSource.php src/Model/KVItemsCreate200Response.php src/Model/KVItemsDelete200Response.php src/Model/KVItemsShow200Response.php src/Model/KVItemsShow200ResponseValue.php +src/Model/KVLinkToProject200Response.php +src/Model/KVLinkToProjectRequest.php src/Model/ListAIAgents200Response.php src/Model/ListAIAgents200ResponseAgentsInner.php src/Model/ListAIModels200Response.php @@ -547,11 +734,33 @@ src/Model/ListCustomTools200Response.php src/Model/ListCustomTools200ResponseToolsInner.php src/Model/ListFiles200Response.php src/Model/ListFiles200ResponseFilesInner.php +src/Model/ListOrchestrationBatches200Response.php +src/Model/ListOrchestrationBatches200ResponseBatchesInner.php +src/Model/ListOrchestrations200Response.php +src/Model/ListSkillCollections200Response.php +src/Model/ListSkillCollections200ResponseCollectionsInner.php +src/Model/ListSkills200Response.php +src/Model/ListSkills200ResponseSkillsInner.php +src/Model/ListSlackBots200Response.php +src/Model/ListSlackBots200ResponseBotsInner.php src/Model/ListTasks200Response.php src/Model/ListTasks200ResponseTasksInner.php src/Model/ListVectorCollections200Response.php src/Model/ListVectorCollections200ResponseCollectionsInner.php src/Model/ModelInterface.php +src/Model/OaiChatCompletions200Response.php +src/Model/OaiChatCompletions200ResponseChoicesInner.php +src/Model/OaiChatCompletions200ResponseChoicesInnerMessage.php +src/Model/OaiChatCompletions200ResponseUsage.php +src/Model/OaiChatCompletionsRequest.php +src/Model/OaiChatCompletionsRequestMessagesInner.php +src/Model/OaiEmbeddings200Response.php +src/Model/OaiEmbeddings200ResponseDataInner.php +src/Model/OaiEmbeddings200ResponseUsage.php +src/Model/OaiEmbeddingsRequest.php +src/Model/OaiGetModel200Response.php +src/Model/OaiListModels200Response.php +src/Model/OaiListModels200ResponseDataInner.php src/Model/OrganizationsList200ResponseInner.php src/Model/PatchEnvironmentCompose202Response.php src/Model/PatchEnvironmentCompose202ResponseSpotConfiguration.php @@ -564,13 +773,27 @@ src/Model/QueryVectorCollection200ResponsePagination.php src/Model/QueryVectorCollection200ResponseResultsInner.php src/Model/QueryVectorCollectionRequest.php src/Model/QueryVectorCollectionRequestFilter.php -src/Model/ScalingPolicy.php +src/Model/RestoreDatabase202Response.php +src/Model/RestoreDatabaseRequest.php +src/Model/RestoreFilesystem202Response.php +src/Model/RestoreFilesystemRequest.php +src/Model/ScalingPolicyListResponse.php +src/Model/SearchSlackWorkspaceChannels200Response.php +src/Model/SearchSlackWorkspaceChannels200ResponseResultsInner.php +src/Model/SearchSlackWorkspaceUsers200Response.php +src/Model/SearchSlackWorkspaceUsers200ResponseResultsInner.php +src/Model/SetScalingPolicyRequest.php src/Model/SpotConfiguration.php src/Model/SubmitToolCallback200Response.php src/Model/SubmitToolCallbackRequest.php src/Model/SubmitToolCallbackRequestToolResultsInner.php src/Model/SyncOperation.php +src/Model/SyncSkillCollection200Response.php src/Model/SyncToEnvironmentRequest.php +src/Model/TokensCreate201Response.php +src/Model/TokensCreateRequest.php +src/Model/TokensDelete200Response.php +src/Model/TokensList200ResponseInner.php src/Model/UpdateAIAgent200Response.php src/Model/UpdateAIAgentRequest.php src/Model/UpdateAISession200Response.php @@ -580,6 +803,12 @@ src/Model/UpdateCronJobRequest.php src/Model/UpdateEnvironmentRequest.php src/Model/UpdateEnvironmentStateRequest.php src/Model/UpdateEnvironmentVariableRequest.php +src/Model/UpdateFilterPolicyRequest.php +src/Model/UpdateGovernanceConfig200Response.php +src/Model/UpdateGovernanceConfigRequest.php +src/Model/UpdateSkill200Response.php +src/Model/UpdateSkillRequest.php +src/Model/UpdateSlackBotRequest.php src/Model/UpdateTask200Response.php src/Model/UpdateTaskRequest.php src/Model/UploadFile201Response.php @@ -588,6 +817,8 @@ src/Model/UploadVectorDocuments200Response.php src/Model/UploadVectorDocumentsRequest.php src/Model/UploadVectorDocumentsRequestDocumentsInner.php src/Model/UploadVectorDocumentsRequestDocumentsInnerMetadata.php +src/Model/UpsertAgentOverlay200Response.php +src/Model/UpsertAgentOverlayRequest.php src/Model/V1ContentItem.php src/Model/V1ContentListResponse.php src/Model/V1ContentRequest.php @@ -643,6 +874,11 @@ src/Model/V2DomainDnsGoLiveRecordsInner.php src/Model/V2DomainDnsValidationRecordsInner.php src/Model/V2DomainRequest.php src/Model/V2Error.php +src/Model/V2MetricData.php +src/Model/V2MetricDataPoint.php +src/Model/V2MetricDataPointTimestamp.php +src/Model/V2MetricsMeta.php +src/Model/V2MetricsResponse.php src/Model/V2Organization.php src/Model/V2OrganizationRequest.php src/Model/V2Project.php diff --git a/README.md b/README.md index 6f5f058f..91867c7a 100644 --- a/README.md +++ b/README.md @@ -52,21 +52,23 @@ require_once(__DIR__ . '/vendor/autoload.php'); $config = QuantClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -$apiInstance = new QuantClient\Api\AIAgentsApi( +$apiInstance = new QuantClient\Api\AIApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); -$organisation = 'organisation_example'; // string | The organisation ID -$agent_id = 'agent_id_example'; // string | The agent ID -$chat_with_ai_agent_request = new \QuantClient\Model\ChatWithAIAgentRequest(); // \QuantClient\Model\ChatWithAIAgentRequest +$organisation = 'organisation_example'; // string +$month = 'month_example'; // string | YYYY-MM, defaults to current month +$group_by = 'model'; // string +$include = 'include_example'; // string | Set to 'daily' to append a 30-day series +$user_id = 'user_id_example'; // string | Scope the daily series to a user +$token_id = 'token_id_example'; // string | Scope the daily series to a token try { - $result = $apiInstance->chatWithAIAgent($organisation, $agent_id, $chat_with_ai_agent_request); - print_r($result); + $apiInstance->getAIUsageStats($organisation, $month, $group_by, $include, $user_id, $token_id); } catch (Exception $e) { - echo 'Exception when calling AIAgentsApi->chatWithAIAgent: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AIApi->getAIUsageStats: ', $e->getMessage(), PHP_EOL; } ``` @@ -77,19 +79,34 @@ All URIs are relative to *https://dashboard.quantcdn.io* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AIApi* | [**getAIUsageStats**](docs/Api/AIApi.md#getaiusagestats) | **GET** /api/v3/organizations/{organisation}/ai/usage | Organisation AI usage breakdown (subscription page parity) *AIAgentsApi* | [**chatWithAIAgent**](docs/Api/AIAgentsApi.md#chatwithaiagent) | **POST** /api/v3/organizations/{organisation}/ai/agents/{agentId}/chat | Chat with AI Agent *AIAgentsApi* | [**createAIAgent**](docs/Api/AIAgentsApi.md#createaiagent) | **POST** /api/v3/organizations/{organisation}/ai/agents | Create AI Agent *AIAgentsApi* | [**deleteAIAgent**](docs/Api/AIAgentsApi.md#deleteaiagent) | **DELETE** /api/v3/organizations/{organisation}/ai/agents/{agentId} | Delete Agent +*AIAgentsApi* | [**deleteAgentOverlay**](docs/Api/AIAgentsApi.md#deleteagentoverlay) | **DELETE** /api/v3/organizations/{organisation}/ai/agents/{agentId}/overlay | Delete Agent Overlay *AIAgentsApi* | [**getAIAgent**](docs/Api/AIAgentsApi.md#getaiagent) | **GET** /api/v3/organizations/{organisation}/ai/agents/{agentId} | Get Agent Details +*AIAgentsApi* | [**getAgentOverlay**](docs/Api/AIAgentsApi.md#getagentoverlay) | **GET** /api/v3/organizations/{organisation}/ai/agents/{agentId}/overlay | Get Agent Overlay *AIAgentsApi* | [**listAIAgents**](docs/Api/AIAgentsApi.md#listaiagents) | **GET** /api/v3/organizations/{organisation}/ai/agents | List AI Agents *AIAgentsApi* | [**updateAIAgent**](docs/Api/AIAgentsApi.md#updateaiagent) | **PUT** /api/v3/organizations/{organisation}/ai/agents/{agentId} | Update Agent +*AIAgentsApi* | [**upsertAgentOverlay**](docs/Api/AIAgentsApi.md#upsertagentoverlay) | **PUT** /api/v3/organizations/{organisation}/ai/agents/{agentId}/overlay | Upsert Agent Overlay *AICustomToolsApi* | [**createCustomTool**](docs/Api/AICustomToolsApi.md#createcustomtool) | **POST** /api/v3/organizations/{organisation}/ai/custom-tools | Register Custom Edge Function Tool *AICustomToolsApi* | [**deleteCustomTool**](docs/Api/AICustomToolsApi.md#deletecustomtool) | **DELETE** /api/v3/organizations/{organisation}/ai/custom-tools/{toolName} | Delete Custom Tool +*AICustomToolsApi* | [**getCustomTool**](docs/Api/AICustomToolsApi.md#getcustomtool) | **GET** /api/v3/organizations/{organisation}/ai/custom-tools/{toolName} | Get Custom Tool *AICustomToolsApi* | [**listCustomTools**](docs/Api/AICustomToolsApi.md#listcustomtools) | **GET** /api/v3/organizations/{organisation}/ai/custom-tools | List Custom Tools *AIFileStorageApi* | [**deleteFile**](docs/Api/AIFileStorageApi.md#deletefile) | **DELETE** /api/v3/organizations/{organisation}/ai/files/{fileId} | Delete File *AIFileStorageApi* | [**getFile**](docs/Api/AIFileStorageApi.md#getfile) | **GET** /api/v3/organizations/{organisation}/ai/files/{fileId} | Get File *AIFileStorageApi* | [**listFiles**](docs/Api/AIFileStorageApi.md#listfiles) | **GET** /api/v3/organizations/{organisation}/ai/files | List Files *AIFileStorageApi* | [**uploadFile**](docs/Api/AIFileStorageApi.md#uploadfile) | **POST** /api/v3/organizations/{organisation}/ai/files | Upload File to S3 +*AIFilterPoliciesApi* | [**createFilterPolicy**](docs/Api/AIFilterPoliciesApi.md#createfilterpolicy) | **POST** /api/v3/organizations/{organisation}/ai/filter-policies | Create an AI filter policy for an organisation +*AIFilterPoliciesApi* | [**deleteFilterPolicy**](docs/Api/AIFilterPoliciesApi.md#deletefilterpolicy) | **DELETE** /api/v3/organizations/{organisation}/ai/filter-policies/{policyId} | Delete a specific AI filter policy +*AIFilterPoliciesApi* | [**disableFilterPolicy**](docs/Api/AIFilterPoliciesApi.md#disablefilterpolicy) | **PUT** /api/v3/organizations/{organisation}/ai/filter-policies/{policyId}/disable | Disable a specific AI filter policy +*AIFilterPoliciesApi* | [**enableFilterPolicy**](docs/Api/AIFilterPoliciesApi.md#enablefilterpolicy) | **PUT** /api/v3/organizations/{organisation}/ai/filter-policies/{policyId}/enable | Enable a specific AI filter policy +*AIFilterPoliciesApi* | [**getFilterPolicy**](docs/Api/AIFilterPoliciesApi.md#getfilterpolicy) | **GET** /api/v3/organizations/{organisation}/ai/filter-policies/{policyId} | Get a specific AI filter policy +*AIFilterPoliciesApi* | [**listFilterPolicies**](docs/Api/AIFilterPoliciesApi.md#listfilterpolicies) | **GET** /api/v3/organizations/{organisation}/ai/filter-policies | List AI filter policies for an organisation +*AIFilterPoliciesApi* | [**updateFilterPolicy**](docs/Api/AIFilterPoliciesApi.md#updatefilterpolicy) | **PUT** /api/v3/organizations/{organisation}/ai/filter-policies/{policyId} | Update a specific AI filter policy +*AIGovernanceApi* | [**getGovernanceConfig**](docs/Api/AIGovernanceApi.md#getgovernanceconfig) | **GET** /api/v3/organizations/{organisation}/ai/governance | Get AI governance configuration for an organisation +*AIGovernanceApi* | [**getGovernanceSpend**](docs/Api/AIGovernanceApi.md#getgovernancespend) | **GET** /api/v3/organizations/{organisation}/ai/governance/spend | Get AI spend summary for an organisation +*AIGovernanceApi* | [**updateGovernanceConfig**](docs/Api/AIGovernanceApi.md#updategovernanceconfig) | **PUT** /api/v3/organizations/{organisation}/ai/governance | Update AI governance configuration for an organisation *AIInferenceApi* | [**chatInference**](docs/Api/AIInferenceApi.md#chatinference) | **POST** /api/v3/organizations/{organisation}/ai/chat | Chat inference via API Gateway (buffered responses) with multimodal support *AIInferenceApi* | [**chatInferenceStream**](docs/Api/AIInferenceApi.md#chatinferencestream) | **POST** /api/v3/organizations/{organisation}/ai/chat/stream | Chat inference via streaming endpoint (true HTTP streaming) with multimodal support *AIInferenceApi* | [**embeddings**](docs/Api/AIInferenceApi.md#embeddings) | **POST** /api/v3/organizations/{organisation}/ai/embeddings | Generate text embeddings for semantic search and RAG applications @@ -98,28 +115,74 @@ Class | Method | HTTP request | Description *AIInferenceApi* | [**submitToolCallback**](docs/Api/AIInferenceApi.md#submittoolcallback) | **POST** /api/v3/organizations/{organisation}/ai/chat/callback | Submit Client Tool Results (Callback) *AIModelsApi* | [**getAIModel**](docs/Api/AIModelsApi.md#getaimodel) | **GET** /api/v3/organizations/{organisation}/ai/models/{modelId} | Get AI Model Details *AIModelsApi* | [**listAIModels**](docs/Api/AIModelsApi.md#listaimodels) | **GET** /api/v3/organizations/{organisation}/ai/models | List available AI models for an organization -*AIMonitoringApi* | [**getAIUsageStats**](docs/Api/AIMonitoringApi.md#getaiusagestats) | **GET** /api/v3/organizations/{organisation}/ai/usage | Get AI usage statistics +*AIOrchestrationsApi* | [**cancelOrchestration**](docs/Api/AIOrchestrationsApi.md#cancelorchestration) | **POST** /api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}/cancel | Cancel Durable Orchestration +*AIOrchestrationsApi* | [**createOrchestration**](docs/Api/AIOrchestrationsApi.md#createorchestration) | **POST** /api/v3/organizations/{organisation}/ai/orchestrations | Create Durable Orchestration +*AIOrchestrationsApi* | [**deleteOrchestration**](docs/Api/AIOrchestrationsApi.md#deleteorchestration) | **DELETE** /api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId} | Delete Durable Orchestration +*AIOrchestrationsApi* | [**getOrchestration**](docs/Api/AIOrchestrationsApi.md#getorchestration) | **GET** /api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId} | Get Durable Orchestration +*AIOrchestrationsApi* | [**listOrchestrationBatches**](docs/Api/AIOrchestrationsApi.md#listorchestrationbatches) | **GET** /api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}/batches | List Orchestration Batches +*AIOrchestrationsApi* | [**listOrchestrations**](docs/Api/AIOrchestrationsApi.md#listorchestrations) | **GET** /api/v3/organizations/{organisation}/ai/orchestrations | List Durable Orchestrations +*AIOrchestrationsApi* | [**pauseOrchestration**](docs/Api/AIOrchestrationsApi.md#pauseorchestration) | **POST** /api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}/pause | Pause Durable Orchestration +*AIOrchestrationsApi* | [**resumeOrchestration**](docs/Api/AIOrchestrationsApi.md#resumeorchestration) | **POST** /api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}/resume | Resume Durable Orchestration +*AIOrchestrationsApi* | [**startOrchestration**](docs/Api/AIOrchestrationsApi.md#startorchestration) | **POST** /api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}/start | Start Durable Orchestration +*AISearchApi* | [**aiSearchChat**](docs/Api/AISearchApi.md#aisearchchat) | **POST** /api/v3/organisations/{organisation}/projects/{project}/ai-search/chat | RAG chat with AI Search content +*AISearchApi* | [**aiSearchDeletePages**](docs/Api/AISearchApi.md#aisearchdeletepages) | **DELETE** /api/v3/organisations/{organisation}/projects/{project}/ai-search/pages | Delete pages by URLs or patterns +*AISearchApi* | [**aiSearchDisable**](docs/Api/AISearchApi.md#aisearchdisable) | **POST** /api/v3/organisations/{organisation}/projects/{project}/ai-search/disable | Disable AI Search for a project +*AISearchApi* | [**aiSearchEnable**](docs/Api/AISearchApi.md#aisearchenable) | **POST** /api/v3/organisations/{organisation}/projects/{project}/ai-search/enable | Enable AI Search for a project +*AISearchApi* | [**aiSearchGetCrawl**](docs/Api/AISearchApi.md#aisearchgetcrawl) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search/crawls/{jobId} | Get AI Search ingest job status +*AISearchApi* | [**aiSearchGetCrawlPages**](docs/Api/AISearchApi.md#aisearchgetcrawlpages) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search/crawls/{jobId}/pages | Get per-page ingest results for a crawl job +*AISearchApi* | [**aiSearchGetSettings**](docs/Api/AISearchApi.md#aisearchgetsettings) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search/settings | Get AI Search public access and rate limit settings +*AISearchApi* | [**aiSearchIngestPages**](docs/Api/AISearchApi.md#aisearchingestpages) | **POST** /api/v3/organisations/{organisation}/projects/{project}/ai-search/pages | Ingest pages into the AI Search index +*AISearchApi* | [**aiSearchListCrawls**](docs/Api/AISearchApi.md#aisearchlistcrawls) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search/crawls | List AI Search ingest jobs +*AISearchApi* | [**aiSearchListPages**](docs/Api/AISearchApi.md#aisearchlistpages) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search/pages | List indexed pages with cursor pagination +*AISearchApi* | [**aiSearchPurgeIndex**](docs/Api/AISearchApi.md#aisearchpurgeindex) | **DELETE** /api/v3/organisations/{organisation}/projects/{project}/ai-search/index | Purge the entire AI Search index +*AISearchApi* | [**aiSearchSearch**](docs/Api/AISearchApi.md#aisearchsearch) | **POST** /api/v3/organisations/{organisation}/projects/{project}/ai-search/search | Semantic search across the AI Search index +*AISearchApi* | [**aiSearchStatus**](docs/Api/AISearchApi.md#aisearchstatus) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search | Get AI Search status for a project +*AISearchApi* | [**aiSearchTopQueries**](docs/Api/AISearchApi.md#aisearchtopqueries) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search/top-queries | Get the most popular AI Search queries +*AISearchApi* | [**aiSearchTriggerCrawl**](docs/Api/AISearchApi.md#aisearchtriggercrawl) | **POST** /api/v3/organisations/{organisation}/projects/{project}/ai-search/crawls | Trigger a crawler run that ingests into AI Search +*AISearchApi* | [**aiSearchUpdateSettings**](docs/Api/AISearchApi.md#aisearchupdatesettings) | **PUT** /api/v3/organisations/{organisation}/projects/{project}/ai-search/settings | Update AI Search public access and rate limit settings +*AISearchApi* | [**aiSearchUsage**](docs/Api/AISearchApi.md#aisearchusage) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search/usage | Get usage statistics for the AI Search site *AISessionsApi* | [**createAISession**](docs/Api/AISessionsApi.md#createaisession) | **POST** /api/v3/organizations/{organisation}/ai/sessions | Create a new chat session with multi-tenant isolation *AISessionsApi* | [**deleteAISession**](docs/Api/AISessionsApi.md#deleteaisession) | **DELETE** /api/v3/organizations/{organisation}/ai/sessions/{sessionId} | Delete a chat session *AISessionsApi* | [**extendAISession**](docs/Api/AISessionsApi.md#extendaisession) | **PUT** /api/v3/organizations/{organisation}/ai/sessions/{sessionId}/extend | Extend Session Expiration *AISessionsApi* | [**getAISession**](docs/Api/AISessionsApi.md#getaisession) | **GET** /api/v3/organizations/{organisation}/ai/sessions/{sessionId} | Get a specific chat session *AISessionsApi* | [**listAISessions**](docs/Api/AISessionsApi.md#listaisessions) | **GET** /api/v3/organizations/{organisation}/ai/sessions | List chat sessions with multi-tenant filtering *AISessionsApi* | [**updateAISession**](docs/Api/AISessionsApi.md#updateaisession) | **PUT** /api/v3/organizations/{organisation}/ai/sessions/{sessionId} | Update Session +*AISkillsApi* | [**createSkill**](docs/Api/AISkillsApi.md#createskill) | **POST** /api/v3/organizations/{organisation}/ai/skills | Create Inline Skill +*AISkillsApi* | [**deleteSkill**](docs/Api/AISkillsApi.md#deleteskill) | **DELETE** /api/v3/organizations/{organisation}/ai/skills/{skillId} | Delete Skill +*AISkillsApi* | [**deleteSkillCollection**](docs/Api/AISkillsApi.md#deleteskillcollection) | **DELETE** /api/v3/organizations/{organisation}/ai/skills/collections/{namespace} | Delete Skill Collection +*AISkillsApi* | [**getSkill**](docs/Api/AISkillsApi.md#getskill) | **GET** /api/v3/organizations/{organisation}/ai/skills/{skillId} | Get Skill Details +*AISkillsApi* | [**importSkill**](docs/Api/AISkillsApi.md#importskill) | **POST** /api/v3/organizations/{organisation}/ai/skills/import | Import Skill from External Source +*AISkillsApi* | [**importSkillCollection**](docs/Api/AISkillsApi.md#importskillcollection) | **POST** /api/v3/organizations/{organisation}/ai/skills/import-collection | Import Skill Collection from GitHub +*AISkillsApi* | [**listSkillCollections**](docs/Api/AISkillsApi.md#listskillcollections) | **GET** /api/v3/organizations/{organisation}/ai/skills/collections | List Skill Collections +*AISkillsApi* | [**listSkills**](docs/Api/AISkillsApi.md#listskills) | **GET** /api/v3/organizations/{organisation}/ai/skills | List Organization's Skills +*AISkillsApi* | [**syncSkill**](docs/Api/AISkillsApi.md#syncskill) | **POST** /api/v3/organizations/{organisation}/ai/skills/{skillId}/sync | Sync Skill from Source +*AISkillsApi* | [**syncSkillCollection**](docs/Api/AISkillsApi.md#syncskillcollection) | **POST** /api/v3/organizations/{organisation}/ai/skills/collections/{namespace}/sync | Sync Skill Collection +*AISkillsApi* | [**updateSkill**](docs/Api/AISkillsApi.md#updateskill) | **PUT** /api/v3/organizations/{organisation}/ai/skills/{skillId} | Update Skill +*AISlackBotsApi* | [**createSlackBot**](docs/Api/AISlackBotsApi.md#createslackbot) | **POST** /api/v3/organizations/{organisation}/ai/slack-bots | Create Slack Bot +*AISlackBotsApi* | [**deleteSlackBot**](docs/Api/AISlackBotsApi.md#deleteslackbot) | **DELETE** /api/v3/organizations/{organisation}/ai/slack-bots/{botId} | Delete Slack Bot +*AISlackBotsApi* | [**getSlackBot**](docs/Api/AISlackBotsApi.md#getslackbot) | **GET** /api/v3/organizations/{organisation}/ai/slack-bots/{botId} | Get Slack Bot +*AISlackBotsApi* | [**listSlackBots**](docs/Api/AISlackBotsApi.md#listslackbots) | **GET** /api/v3/organizations/{organisation}/ai/slack-bots | List Slack Bots +*AISlackBotsApi* | [**searchSlackWorkspaceChannels**](docs/Api/AISlackBotsApi.md#searchslackworkspacechannels) | **GET** /api/v3/organizations/{organisation}/ai/slack-bots/{botId}/workspace/channels | Search Slack Workspace Channels +*AISlackBotsApi* | [**searchSlackWorkspaceUsers**](docs/Api/AISlackBotsApi.md#searchslackworkspaceusers) | **GET** /api/v3/organizations/{organisation}/ai/slack-bots/{botId}/workspace/users | Search Slack Workspace Users +*AISlackBotsApi* | [**updateSlackBot**](docs/Api/AISlackBotsApi.md#updateslackbot) | **PUT** /api/v3/organizations/{organisation}/ai/slack-bots/{botId} | Update Slack Bot *AITaskManagementApi* | [**createTask**](docs/Api/AITaskManagementApi.md#createtask) | **POST** /api/v3/organizations/{organisation}/ai/tasks | Create a new task *AITaskManagementApi* | [**deleteTask**](docs/Api/AITaskManagementApi.md#deletetask) | **DELETE** /api/v3/organizations/{organisation}/ai/tasks/{taskId} | Delete a task *AITaskManagementApi* | [**getDependencyGraph**](docs/Api/AITaskManagementApi.md#getdependencygraph) | **GET** /api/v3/organizations/{organisation}/ai/tasks/{taskListId}/dependency-graph | Get dependency graph for a task list *AITaskManagementApi* | [**getTask**](docs/Api/AITaskManagementApi.md#gettask) | **GET** /api/v3/organizations/{organisation}/ai/tasks/{taskId} | Get task details *AITaskManagementApi* | [**listTasks**](docs/Api/AITaskManagementApi.md#listtasks) | **GET** /api/v3/organizations/{organisation}/ai/tasks | List tasks with optional filtering *AITaskManagementApi* | [**updateTask**](docs/Api/AITaskManagementApi.md#updatetask) | **PUT** /api/v3/organizations/{organisation}/ai/tasks/{taskId} | Update a task -*AIToolsApi* | [**getAIOrchestrationStatus**](docs/Api/AIToolsApi.md#getaiorchestrationstatus) | **GET** /api/v3/organizations/{organisation}/ai/tools/orchestrations/{orchestrationId} | Get Orchestration Status +*AIToolsApi* | [**getAIOrchestrationStatus**](docs/Api/AIToolsApi.md#getaiorchestrationstatus) | **GET** /api/v3/organizations/{organisation}/ai/tools/orchestrations/{orchestrationId} | Get Tool Orchestration Status (Async Tool Polling) *AIToolsApi* | [**getAIToolExecutionStatus**](docs/Api/AIToolsApi.md#getaitoolexecutionstatus) | **GET** /api/v3/organizations/{organisation}/ai/tools/executions/{executionId} | Get async tool execution status and result *AIToolsApi* | [**listAIToolExecutions**](docs/Api/AIToolsApi.md#listaitoolexecutions) | **GET** /api/v3/organizations/{organisation}/ai/tools/executions | List tool executions for monitoring and debugging *AIToolsApi* | [**listAIToolNames**](docs/Api/AIToolsApi.md#listaitoolnames) | **GET** /api/v3/organizations/{organisation}/ai/tools/names | List tool names only (lightweight response) *AIToolsApi* | [**listAITools**](docs/Api/AIToolsApi.md#listaitools) | **GET** /api/v3/organizations/{organisation}/ai/tools | List available built-in tools for function calling +*AIUsageApi* | [**getMyUsage**](docs/Api/AIUsageApi.md#getmyusage) | **GET** /api/v3/organizations/{organisation}/ai/usage/me | Get AI usage summary for the authenticated user *AIVectorDatabaseApi* | [**createVectorCollection**](docs/Api/AIVectorDatabaseApi.md#createvectorcollection) | **POST** /api/v3/organizations/{organisation}/ai/vector-db/collections | Create Vector Database Collection *AIVectorDatabaseApi* | [**deleteVectorCollection**](docs/Api/AIVectorDatabaseApi.md#deletevectorcollection) | **DELETE** /api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId} | Delete Collection +*AIVectorDatabaseApi* | [**deleteVectorDocuments**](docs/Api/AIVectorDatabaseApi.md#deletevectordocuments) | **DELETE** /api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId}/documents | Delete Documents from Collection *AIVectorDatabaseApi* | [**getVectorCollection**](docs/Api/AIVectorDatabaseApi.md#getvectorcollection) | **GET** /api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId} | Get Collection Details *AIVectorDatabaseApi* | [**listVectorCollections**](docs/Api/AIVectorDatabaseApi.md#listvectorcollections) | **GET** /api/v3/organizations/{organisation}/ai/vector-db/collections | List Vector Database Collections +*AIVectorDatabaseApi* | [**listVectorDocuments**](docs/Api/AIVectorDatabaseApi.md#listvectordocuments) | **GET** /api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId}/documents | List Documents in Collection *AIVectorDatabaseApi* | [**queryVectorCollection**](docs/Api/AIVectorDatabaseApi.md#queryvectorcollection) | **POST** /api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId}/query | Semantic Search Query *AIVectorDatabaseApi* | [**uploadVectorDocuments**](docs/Api/AIVectorDatabaseApi.md#uploadvectordocuments) | **POST** /api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId}/documents | Upload Documents to Collection *ApplicationsApi* | [**createApplication**](docs/Api/ApplicationsApi.md#createapplication) | **POST** /api/v3/organizations/{organisation}/applications | Create a new application @@ -131,6 +194,9 @@ Class | Method | HTTP request | Description *BackupManagementApi* | [**deleteBackup**](docs/Api/BackupManagementApi.md#deletebackup) | **DELETE** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/backups/{type}/{backupId} | Delete a backup *BackupManagementApi* | [**downloadBackup**](docs/Api/BackupManagementApi.md#downloadbackup) | **GET** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/backups/{type}/{backupId}/download | Generate a download URL for a backup *BackupManagementApi* | [**listBackups**](docs/Api/BackupManagementApi.md#listbackups) | **GET** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/backups/{type} | List backups for an environment +*CDNMetricsApi* | [**getDailyMetrics**](docs/Api/CDNMetricsApi.md#getdailymetrics) | **GET** /v2/organizations/{organization}/projects/{project}/metrics/daily | Get daily metrics +*CDNMetricsApi* | [**getHourlyMetrics**](docs/Api/CDNMetricsApi.md#gethourlymetrics) | **GET** /v2/organizations/{organization}/projects/{project}/metrics/hourly | Get hourly metrics +*CDNMetricsApi* | [**getMonthlyMetrics**](docs/Api/CDNMetricsApi.md#getmonthlymetrics) | **GET** /v2/organizations/{organization}/projects/{project}/metrics/monthly | Get monthly metrics *CommandsApi* | [**createCommand**](docs/Api/CommandsApi.md#createcommand) | **POST** /api/v3/organizations/{organisation}/environments/{environment}/commands | Create a command for an environment *CommandsApi* | [**getCommand**](docs/Api/CommandsApi.md#getcommand) | **GET** /api/v3/organizations/{organisation}/environments/{environment}/commands/{command} | Get a command *CommandsApi* | [**listCommands**](docs/Api/CommandsApi.md#listcommands) | **GET** /api/v3/organizations/{organisation}/environments/{environment}/commands | Get all commands for an environment @@ -184,9 +250,14 @@ Class | Method | HTTP request | Description *KVApi* | [**kVItemsList**](docs/Api/KVApi.md#kvitemslist) | **GET** /api/v2/organizations/{organization}/projects/{project}/kv/{store_id}/items | List items in a kv store *KVApi* | [**kVItemsShow**](docs/Api/KVApi.md#kvitemsshow) | **GET** /api/v2/organizations/{organization}/projects/{project}/kv/{store_id}/items/{key} | Get an item from a kv store *KVApi* | [**kVItemsUpdate**](docs/Api/KVApi.md#kvitemsupdate) | **PUT** /api/v2/organizations/{organization}/projects/{project}/kv/{store_id}/items/{key} | Update an item in a kv store +*KVApi* | [**kVLinkToProject**](docs/Api/KVApi.md#kvlinktoproject) | **POST** /api/v2/organizations/{organization}/projects/{project}/kv/{store_id}/link | Link a KV store to another project *KVApi* | [**kVList**](docs/Api/KVApi.md#kvlist) | **GET** /api/v2/organizations/{organization}/projects/{project}/kv | List key-value stores *KVApi* | [**kVShow**](docs/Api/KVApi.md#kvshow) | **GET** /api/v2/organizations/{organization}/projects/{project}/kv/{store_id} | Get a kv store -*OrchestrationApi* | [**getAIOrchestrationStatus**](docs/Api/OrchestrationApi.md#getaiorchestrationstatus) | **GET** /api/v3/organizations/{organisation}/ai/tools/orchestrations/{orchestrationId} | Get Orchestration Status +*KVApi* | [**kVUnlinkFromProject**](docs/Api/KVApi.md#kvunlinkfromproject) | **DELETE** /api/v2/organizations/{organization}/projects/{project}/kv/{store_id}/link | Unlink a KV store from this project +*OpenAICompatibilityApi* | [**oaiChatCompletions**](docs/Api/OpenAICompatibilityApi.md#oaichatcompletions) | **POST** /oai/v1/chat/completions | Create a chat completion (OpenAI-compatible) +*OpenAICompatibilityApi* | [**oaiEmbeddings**](docs/Api/OpenAICompatibilityApi.md#oaiembeddings) | **POST** /oai/v1/embeddings | Create embeddings (OpenAI-compatible) +*OpenAICompatibilityApi* | [**oaiGetModel**](docs/Api/OpenAICompatibilityApi.md#oaigetmodel) | **GET** /oai/v1/models/{model} | Retrieve a model (OpenAI-compatible) +*OpenAICompatibilityApi* | [**oaiListModels**](docs/Api/OpenAICompatibilityApi.md#oailistmodels) | **GET** /oai/v1/models | List available models (OpenAI-compatible) *OrganizationsApi* | [**organizationsList**](docs/Api/OrganizationsApi.md#organizationslist) | **GET** /api/v2/organizations | Retrieve all organizations *OrganizationsApi* | [**organizationsRead**](docs/Api/OrganizationsApi.md#organizationsread) | **GET** /api/v2/organizations/{organization} | Get details of a single organization *ProjectsApi* | [**projectsCreate**](docs/Api/ProjectsApi.md#projectscreate) | **POST** /api/v2/organizations/{organization}/projects | Create a new project @@ -195,6 +266,9 @@ Class | Method | HTTP request | Description *ProjectsApi* | [**projectsRead**](docs/Api/ProjectsApi.md#projectsread) | **GET** /api/v2/organizations/{organization}/projects/{project} | Get details of a single project *ProjectsApi* | [**projectsUpdate**](docs/Api/ProjectsApi.md#projectsupdate) | **PATCH** /api/v2/organizations/{organization}/projects/{project} | Update a project *PurgeApi* | [**purgeCreate**](docs/Api/PurgeApi.md#purgecreate) | **POST** /api/v2/organizations/{organization}/projects/{project}/purge | Purge cache via URL or cache keys +*RestoreManagementApi* | [**getRestoreStatus**](docs/Api/RestoreManagementApi.md#getrestorestatus) | **GET** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/restores/{restoreId} | Get the status of a restore operation +*RestoreManagementApi* | [**restoreDatabase**](docs/Api/RestoreManagementApi.md#restoredatabase) | **POST** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/backups/{backupId}/restore-database | Restore a database backup to a target environment +*RestoreManagementApi* | [**restoreFilesystem**](docs/Api/RestoreManagementApi.md#restorefilesystem) | **POST** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/backups/{backupId}/restore-filesystem | Restore a filesystem backup to a target environment *RulesApi* | [**rulesAuthCreate**](docs/Api/RulesApi.md#rulesauthcreate) | **POST** /api/v2/organizations/{organization}/projects/{project}/rules/auth | Create an authentication rule *RulesApi* | [**rulesAuthDelete**](docs/Api/RulesApi.md#rulesauthdelete) | **DELETE** /api/v2/organizations/{organization}/projects/{project}/rules/auth/{rule} | Delete an authentication rule *RulesApi* | [**rulesAuthList**](docs/Api/RulesApi.md#rulesauthlist) | **GET** /api/v2/organizations/{organization}/projects/{project}/rules/auth | List authentication rules @@ -241,9 +315,13 @@ Class | Method | HTTP request | Description *RulesApi* | [**rulesServeStaticRead**](docs/Api/RulesApi.md#rulesservestaticread) | **GET** /api/v2/organizations/{organization}/projects/{project}/rules/serve-static/{rule} | Get details of a serve static rule *RulesApi* | [**rulesServeStaticUpdate**](docs/Api/RulesApi.md#rulesservestaticupdate) | **PATCH** /api/v2/organizations/{organization}/projects/{project}/rules/serve-static/{rule} | Update a serve static rule *SSHAccessApi* | [**getSshAccessCredentials**](docs/Api/SSHAccessApi.md#getsshaccesscredentials) | **GET** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/ssh-access | Get SSH access credentials for an environment -*ScalingPolicyApi* | [**deleteScalingPolicy**](docs/Api/ScalingPolicyApi.md#deletescalingpolicy) | **DELETE** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies/{policyName} | Delete the scaling policy for an environment -*ScalingPolicyApi* | [**getScalingPolicies**](docs/Api/ScalingPolicyApi.md#getscalingpolicies) | **GET** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies | Get the scaling policies for an environment -*ScalingPolicyApi* | [**updateScalingPolicy**](docs/Api/ScalingPolicyApi.md#updatescalingpolicy) | **PUT** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies | Update the scaling policy for an environment +*ScalingPolicyApi* | [**deleteScalingPolicy**](docs/Api/ScalingPolicyApi.md#deletescalingpolicy) | **DELETE** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies | Delete Scaling Policy +*ScalingPolicyApi* | [**listScalingPolicies**](docs/Api/ScalingPolicyApi.md#listscalingpolicies) | **GET** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies | List Scaling Policies +*ScalingPolicyApi* | [**upsertScalingPolicy**](docs/Api/ScalingPolicyApi.md#upsertscalingpolicy) | **PUT** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies | Upsert Scaling Policy +*SubscriptionApi* | [**getSubscriptionCloudUsage**](docs/Api/SubscriptionApi.md#getsubscriptioncloudusage) | **GET** /api/v3/organizations/{organisation}/subscription/cloud-usage | Cloud-app cost breakdown for the subscription page +*TokensApi* | [**tokensCreate**](docs/Api/TokensApi.md#tokenscreate) | **POST** /api/v2/organizations/{organization}/tokens | Create a new API token scoped to this organization +*TokensApi* | [**tokensDelete**](docs/Api/TokensApi.md#tokensdelete) | **DELETE** /api/v2/organizations/{organization}/tokens/{token_id} | Revoke an API token +*TokensApi* | [**tokensList**](docs/Api/TokensApi.md#tokenslist) | **GET** /api/v2/organizations/{organization}/tokens | List API tokens scoped to this organization *VariablesApi* | [**bulkSetEnvironmentVariables**](docs/Api/VariablesApi.md#bulksetenvironmentvariables) | **PUT** /api/v3/organizations/{api_organisation}/applications/{api_application}/environments/{api_environment}/variables | Bulk set/replace environment variables *VariablesApi* | [**deleteEnvironmentVariable**](docs/Api/VariablesApi.md#deleteenvironmentvariable) | **DELETE** /api/v3/organizations/{api_organisation}/applications/{api_application}/environments/{api_environment}/variables/{api_variable} | Delete a variable *VariablesApi* | [**listEnvironmentVariables**](docs/Api/VariablesApi.md#listenvironmentvariables) | **GET** /api/v3/organizations/{api_organisation}/applications/{api_application}/environments/{api_environment}/variables | Get all variables for an environment @@ -255,10 +333,18 @@ Class | Method | HTTP request | Description ## Models +- [AiSearchChatRequest](docs/Model/AiSearchChatRequest.md) +- [AiSearchDeletePagesRequest](docs/Model/AiSearchDeletePagesRequest.md) +- [AiSearchEnableRequest](docs/Model/AiSearchEnableRequest.md) +- [AiSearchIngestPagesRequest](docs/Model/AiSearchIngestPagesRequest.md) +- [AiSearchIngestPagesRequestPagesInner](docs/Model/AiSearchIngestPagesRequestPagesInner.md) +- [AiSearchSearchRequest](docs/Model/AiSearchSearchRequest.md) +- [AiSearchTriggerCrawlRequest](docs/Model/AiSearchTriggerCrawlRequest.md) +- [AiSearchUpdateSettingsRequest](docs/Model/AiSearchUpdateSettingsRequest.md) - [Application](docs/Model/Application.md) +- [ApplicationCache](docs/Model/ApplicationCache.md) - [ApplicationDatabase](docs/Model/ApplicationDatabase.md) - [ApplicationDeploymentInformationInner](docs/Model/ApplicationDeploymentInformationInner.md) -- [ApplicationEnvironmentsInner](docs/Model/ApplicationEnvironmentsInner.md) - [ApplicationFilesystem](docs/Model/ApplicationFilesystem.md) - [ApplicationImageReference](docs/Model/ApplicationImageReference.md) - [BulkSetEnvironmentVariablesRequest](docs/Model/BulkSetEnvironmentVariablesRequest.md) @@ -272,6 +358,7 @@ Class | Method | HTTP request | Description - [ChatInference200ResponseUsage](docs/Model/ChatInference200ResponseUsage.md) - [ChatInference202Response](docs/Model/ChatInference202Response.md) - [ChatInferenceRequest](docs/Model/ChatInferenceRequest.md) +- [ChatInferenceRequestGuardrails](docs/Model/ChatInferenceRequestGuardrails.md) - [ChatInferenceRequestMessagesInner](docs/Model/ChatInferenceRequestMessagesInner.md) - [ChatInferenceRequestMessagesInnerContent](docs/Model/ChatInferenceRequestMessagesInnerContent.md) - [ChatInferenceRequestMessagesInnerContentOneOfInner](docs/Model/ChatInferenceRequestMessagesInnerContentOneOfInner.md) @@ -329,6 +416,16 @@ Class | Method | HTTP request | Description - [CreateEnvironment403Response](docs/Model/CreateEnvironment403Response.md) - [CreateEnvironmentRequest](docs/Model/CreateEnvironmentRequest.md) - [CreateEnvironmentRequestEnvironmentInner](docs/Model/CreateEnvironmentRequestEnvironmentInner.md) +- [CreateFilterPolicyRequest](docs/Model/CreateFilterPolicyRequest.md) +- [CreateFilterPolicyRequestRulesInner](docs/Model/CreateFilterPolicyRequestRulesInner.md) +- [CreateFilterPolicyRequestRulesInnerMatch](docs/Model/CreateFilterPolicyRequestRulesInnerMatch.md) +- [CreateOrchestrationRequest](docs/Model/CreateOrchestrationRequest.md) +- [CreateOrchestrationRequestInputSource](docs/Model/CreateOrchestrationRequestInputSource.md) +- [CreateOrchestrationRequestStopCondition](docs/Model/CreateOrchestrationRequestStopCondition.md) +- [CreateSkill201Response](docs/Model/CreateSkill201Response.md) +- [CreateSkillRequest](docs/Model/CreateSkillRequest.md) +- [CreateSlackBot201Response](docs/Model/CreateSlackBot201Response.md) +- [CreateSlackBotRequest](docs/Model/CreateSlackBotRequest.md) - [CreateTask201Response](docs/Model/CreateTask201Response.md) - [CreateTaskRequest](docs/Model/CreateTaskRequest.md) - [CreateVectorCollection201Response](docs/Model/CreateVectorCollection201Response.md) @@ -339,12 +436,18 @@ Class | Method | HTTP request | Description - [CronRun](docs/Model/CronRun.md) - [DeleteAIAgent200Response](docs/Model/DeleteAIAgent200Response.md) - [DeleteAISession200Response](docs/Model/DeleteAISession200Response.md) +- [DeleteAgentOverlay200Response](docs/Model/DeleteAgentOverlay200Response.md) - [DeleteBackup200Response](docs/Model/DeleteBackup200Response.md) - [DeleteCustomTool200Response](docs/Model/DeleteCustomTool200Response.md) - [DeleteFile200Response](docs/Model/DeleteFile200Response.md) +- [DeleteSkill200Response](docs/Model/DeleteSkill200Response.md) +- [DeleteSkillCollection200Response](docs/Model/DeleteSkillCollection200Response.md) +- [DeleteSlackBot200Response](docs/Model/DeleteSlackBot200Response.md) - [DeleteTask200Response](docs/Model/DeleteTask200Response.md) - [DeleteTask409Response](docs/Model/DeleteTask409Response.md) -- [DeleteVectorCollection200Response](docs/Model/DeleteVectorCollection200Response.md) +- [DeleteVectorDocuments200Response](docs/Model/DeleteVectorDocuments200Response.md) +- [DeleteVectorDocumentsRequest](docs/Model/DeleteVectorDocumentsRequest.md) +- [DeleteVectorDocumentsRequestMetadata](docs/Model/DeleteVectorDocumentsRequestMetadata.md) - [DownloadBackup200Response](docs/Model/DownloadBackup200Response.md) - [Embeddings200Response](docs/Model/Embeddings200Response.md) - [Embeddings200ResponseEmbeddings](docs/Model/Embeddings200ResponseEmbeddings.md) @@ -369,8 +472,11 @@ Class | Method | HTTP request | Description - [GetAIToolExecutionStatus200Response](docs/Model/GetAIToolExecutionStatus200Response.md) - [GetAIToolExecutionStatus200ResponseResult](docs/Model/GetAIToolExecutionStatus200ResponseResult.md) - [GetAIToolExecutionStatus404Response](docs/Model/GetAIToolExecutionStatus404Response.md) -- [GetAIUsageStats200Response](docs/Model/GetAIUsageStats200Response.md) -- [GetAIUsageStats200ResponseByModelValue](docs/Model/GetAIUsageStats200ResponseByModelValue.md) +- [GetAgentOverlay200Response](docs/Model/GetAgentOverlay200Response.md) +- [GetAgentOverlay200ResponseBase](docs/Model/GetAgentOverlay200ResponseBase.md) +- [GetAgentOverlay200ResponseOverlay](docs/Model/GetAgentOverlay200ResponseOverlay.md) +- [GetCustomTool200Response](docs/Model/GetCustomTool200Response.md) +- [GetCustomTool200ResponseTool](docs/Model/GetCustomTool200ResponseTool.md) - [GetDependencyGraph200Response](docs/Model/GetDependencyGraph200Response.md) - [GetDurableExecutionStatus200Response](docs/Model/GetDurableExecutionStatus200Response.md) - [GetDurableExecutionStatus200ResponseError](docs/Model/GetDurableExecutionStatus200ResponseError.md) @@ -382,6 +488,28 @@ Class | Method | HTTP request | Description - [GetEnvironmentLogs200Response](docs/Model/GetEnvironmentLogs200Response.md) - [GetEnvironmentLogs200ResponseLogEventsInner](docs/Model/GetEnvironmentLogs200ResponseLogEventsInner.md) - [GetFile200Response](docs/Model/GetFile200Response.md) +- [GetGovernanceConfig200Response](docs/Model/GetGovernanceConfig200Response.md) +- [GetGovernanceConfig200ResponseSpendLimits](docs/Model/GetGovernanceConfig200ResponseSpendLimits.md) +- [GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue](docs/Model/GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue.md) +- [GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue](docs/Model/GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue.md) +- [GetGovernanceSpend200Response](docs/Model/GetGovernanceSpend200Response.md) +- [GetGovernanceSpend200ResponseBudget](docs/Model/GetGovernanceSpend200ResponseBudget.md) +- [GetGovernanceSpend200ResponseDailyBudget](docs/Model/GetGovernanceSpend200ResponseDailyBudget.md) +- [GetGovernanceSpend200ResponseOrgTotal](docs/Model/GetGovernanceSpend200ResponseOrgTotal.md) +- [GetGovernanceSpend200ResponseTodayTotal](docs/Model/GetGovernanceSpend200ResponseTodayTotal.md) +- [GetGovernanceSpend200ResponseUserTotal](docs/Model/GetGovernanceSpend200ResponseUserTotal.md) +- [GetMyUsage200Response](docs/Model/GetMyUsage200Response.md) +- [GetMyUsage200ResponseDaily](docs/Model/GetMyUsage200ResponseDaily.md) +- [GetMyUsage200ResponseMonthly](docs/Model/GetMyUsage200ResponseMonthly.md) +- [GetMyUsage200ResponseQuota](docs/Model/GetMyUsage200ResponseQuota.md) +- [GetMyUsage200ResponseQuotaDailyLimit](docs/Model/GetMyUsage200ResponseQuotaDailyLimit.md) +- [GetMyUsage200ResponseQuotaMonthlyLimit](docs/Model/GetMyUsage200ResponseQuotaMonthlyLimit.md) +- [GetRestoreStatus200Response](docs/Model/GetRestoreStatus200Response.md) +- [GetScalingPolicyResponse](docs/Model/GetScalingPolicyResponse.md) +- [GetSkill200Response](docs/Model/GetSkill200Response.md) +- [GetSkill200ResponseSkill](docs/Model/GetSkill200ResponseSkill.md) +- [GetSlackBot200Response](docs/Model/GetSlackBot200Response.md) +- [GetSlackBot200ResponseBot](docs/Model/GetSlackBot200ResponseBot.md) - [GetSshAccessCredentials200Response](docs/Model/GetSshAccessCredentials200Response.md) - [GetSshAccessCredentials200ResponseCredentials](docs/Model/GetSshAccessCredentials200ResponseCredentials.md) - [GetTask200Response](docs/Model/GetTask200Response.md) @@ -396,10 +524,18 @@ Class | Method | HTTP request | Description - [ImageGenerationRequestInPaintingParams](docs/Model/ImageGenerationRequestInPaintingParams.md) - [ImageGenerationRequestOutPaintingParams](docs/Model/ImageGenerationRequestOutPaintingParams.md) - [ImageGenerationRequestTextToImageParams](docs/Model/ImageGenerationRequestTextToImageParams.md) +- [ImportSkill201Response](docs/Model/ImportSkill201Response.md) +- [ImportSkillCollection201Response](docs/Model/ImportSkillCollection201Response.md) +- [ImportSkillCollectionRequest](docs/Model/ImportSkillCollectionRequest.md) +- [ImportSkillCollectionRequestSource](docs/Model/ImportSkillCollectionRequestSource.md) +- [ImportSkillRequest](docs/Model/ImportSkillRequest.md) +- [ImportSkillRequestSource](docs/Model/ImportSkillRequestSource.md) - [KVItemsCreate200Response](docs/Model/KVItemsCreate200Response.md) - [KVItemsDelete200Response](docs/Model/KVItemsDelete200Response.md) - [KVItemsShow200Response](docs/Model/KVItemsShow200Response.md) - [KVItemsShow200ResponseValue](docs/Model/KVItemsShow200ResponseValue.md) +- [KVLinkToProject200Response](docs/Model/KVLinkToProject200Response.md) +- [KVLinkToProjectRequest](docs/Model/KVLinkToProjectRequest.md) - [ListAIAgents200Response](docs/Model/ListAIAgents200Response.md) - [ListAIAgents200ResponseAgentsInner](docs/Model/ListAIAgents200ResponseAgentsInner.md) - [ListAIModels200Response](docs/Model/ListAIModels200Response.md) @@ -420,10 +556,32 @@ Class | Method | HTTP request | Description - [ListCustomTools200ResponseToolsInner](docs/Model/ListCustomTools200ResponseToolsInner.md) - [ListFiles200Response](docs/Model/ListFiles200Response.md) - [ListFiles200ResponseFilesInner](docs/Model/ListFiles200ResponseFilesInner.md) +- [ListOrchestrationBatches200Response](docs/Model/ListOrchestrationBatches200Response.md) +- [ListOrchestrationBatches200ResponseBatchesInner](docs/Model/ListOrchestrationBatches200ResponseBatchesInner.md) +- [ListOrchestrations200Response](docs/Model/ListOrchestrations200Response.md) +- [ListSkillCollections200Response](docs/Model/ListSkillCollections200Response.md) +- [ListSkillCollections200ResponseCollectionsInner](docs/Model/ListSkillCollections200ResponseCollectionsInner.md) +- [ListSkills200Response](docs/Model/ListSkills200Response.md) +- [ListSkills200ResponseSkillsInner](docs/Model/ListSkills200ResponseSkillsInner.md) +- [ListSlackBots200Response](docs/Model/ListSlackBots200Response.md) +- [ListSlackBots200ResponseBotsInner](docs/Model/ListSlackBots200ResponseBotsInner.md) - [ListTasks200Response](docs/Model/ListTasks200Response.md) - [ListTasks200ResponseTasksInner](docs/Model/ListTasks200ResponseTasksInner.md) - [ListVectorCollections200Response](docs/Model/ListVectorCollections200Response.md) - [ListVectorCollections200ResponseCollectionsInner](docs/Model/ListVectorCollections200ResponseCollectionsInner.md) +- [OaiChatCompletions200Response](docs/Model/OaiChatCompletions200Response.md) +- [OaiChatCompletions200ResponseChoicesInner](docs/Model/OaiChatCompletions200ResponseChoicesInner.md) +- [OaiChatCompletions200ResponseChoicesInnerMessage](docs/Model/OaiChatCompletions200ResponseChoicesInnerMessage.md) +- [OaiChatCompletions200ResponseUsage](docs/Model/OaiChatCompletions200ResponseUsage.md) +- [OaiChatCompletionsRequest](docs/Model/OaiChatCompletionsRequest.md) +- [OaiChatCompletionsRequestMessagesInner](docs/Model/OaiChatCompletionsRequestMessagesInner.md) +- [OaiEmbeddings200Response](docs/Model/OaiEmbeddings200Response.md) +- [OaiEmbeddings200ResponseDataInner](docs/Model/OaiEmbeddings200ResponseDataInner.md) +- [OaiEmbeddings200ResponseUsage](docs/Model/OaiEmbeddings200ResponseUsage.md) +- [OaiEmbeddingsRequest](docs/Model/OaiEmbeddingsRequest.md) +- [OaiGetModel200Response](docs/Model/OaiGetModel200Response.md) +- [OaiListModels200Response](docs/Model/OaiListModels200Response.md) +- [OaiListModels200ResponseDataInner](docs/Model/OaiListModels200ResponseDataInner.md) - [OrganizationsList200ResponseInner](docs/Model/OrganizationsList200ResponseInner.md) - [PatchEnvironmentCompose202Response](docs/Model/PatchEnvironmentCompose202Response.md) - [PatchEnvironmentCompose202ResponseSpotConfiguration](docs/Model/PatchEnvironmentCompose202ResponseSpotConfiguration.md) @@ -436,13 +594,27 @@ Class | Method | HTTP request | Description - [QueryVectorCollection200ResponseResultsInner](docs/Model/QueryVectorCollection200ResponseResultsInner.md) - [QueryVectorCollectionRequest](docs/Model/QueryVectorCollectionRequest.md) - [QueryVectorCollectionRequestFilter](docs/Model/QueryVectorCollectionRequestFilter.md) -- [ScalingPolicy](docs/Model/ScalingPolicy.md) +- [RestoreDatabase202Response](docs/Model/RestoreDatabase202Response.md) +- [RestoreDatabaseRequest](docs/Model/RestoreDatabaseRequest.md) +- [RestoreFilesystem202Response](docs/Model/RestoreFilesystem202Response.md) +- [RestoreFilesystemRequest](docs/Model/RestoreFilesystemRequest.md) +- [ScalingPolicyListResponse](docs/Model/ScalingPolicyListResponse.md) +- [SearchSlackWorkspaceChannels200Response](docs/Model/SearchSlackWorkspaceChannels200Response.md) +- [SearchSlackWorkspaceChannels200ResponseResultsInner](docs/Model/SearchSlackWorkspaceChannels200ResponseResultsInner.md) +- [SearchSlackWorkspaceUsers200Response](docs/Model/SearchSlackWorkspaceUsers200Response.md) +- [SearchSlackWorkspaceUsers200ResponseResultsInner](docs/Model/SearchSlackWorkspaceUsers200ResponseResultsInner.md) +- [SetScalingPolicyRequest](docs/Model/SetScalingPolicyRequest.md) - [SpotConfiguration](docs/Model/SpotConfiguration.md) - [SubmitToolCallback200Response](docs/Model/SubmitToolCallback200Response.md) - [SubmitToolCallbackRequest](docs/Model/SubmitToolCallbackRequest.md) - [SubmitToolCallbackRequestToolResultsInner](docs/Model/SubmitToolCallbackRequestToolResultsInner.md) - [SyncOperation](docs/Model/SyncOperation.md) +- [SyncSkillCollection200Response](docs/Model/SyncSkillCollection200Response.md) - [SyncToEnvironmentRequest](docs/Model/SyncToEnvironmentRequest.md) +- [TokensCreate201Response](docs/Model/TokensCreate201Response.md) +- [TokensCreateRequest](docs/Model/TokensCreateRequest.md) +- [TokensDelete200Response](docs/Model/TokensDelete200Response.md) +- [TokensList200ResponseInner](docs/Model/TokensList200ResponseInner.md) - [UpdateAIAgent200Response](docs/Model/UpdateAIAgent200Response.md) - [UpdateAIAgentRequest](docs/Model/UpdateAIAgentRequest.md) - [UpdateAISession200Response](docs/Model/UpdateAISession200Response.md) @@ -452,6 +624,12 @@ Class | Method | HTTP request | Description - [UpdateEnvironmentRequest](docs/Model/UpdateEnvironmentRequest.md) - [UpdateEnvironmentStateRequest](docs/Model/UpdateEnvironmentStateRequest.md) - [UpdateEnvironmentVariableRequest](docs/Model/UpdateEnvironmentVariableRequest.md) +- [UpdateFilterPolicyRequest](docs/Model/UpdateFilterPolicyRequest.md) +- [UpdateGovernanceConfig200Response](docs/Model/UpdateGovernanceConfig200Response.md) +- [UpdateGovernanceConfigRequest](docs/Model/UpdateGovernanceConfigRequest.md) +- [UpdateSkill200Response](docs/Model/UpdateSkill200Response.md) +- [UpdateSkillRequest](docs/Model/UpdateSkillRequest.md) +- [UpdateSlackBotRequest](docs/Model/UpdateSlackBotRequest.md) - [UpdateTask200Response](docs/Model/UpdateTask200Response.md) - [UpdateTaskRequest](docs/Model/UpdateTaskRequest.md) - [UploadFile201Response](docs/Model/UploadFile201Response.md) @@ -460,6 +638,8 @@ Class | Method | HTTP request | Description - [UploadVectorDocumentsRequest](docs/Model/UploadVectorDocumentsRequest.md) - [UploadVectorDocumentsRequestDocumentsInner](docs/Model/UploadVectorDocumentsRequestDocumentsInner.md) - [UploadVectorDocumentsRequestDocumentsInnerMetadata](docs/Model/UploadVectorDocumentsRequestDocumentsInnerMetadata.md) +- [UpsertAgentOverlay200Response](docs/Model/UpsertAgentOverlay200Response.md) +- [UpsertAgentOverlayRequest](docs/Model/UpsertAgentOverlayRequest.md) - [V1ContentItem](docs/Model/V1ContentItem.md) - [V1ContentListResponse](docs/Model/V1ContentListResponse.md) - [V1ContentRequest](docs/Model/V1ContentRequest.md) @@ -515,6 +695,11 @@ Class | Method | HTTP request | Description - [V2DomainDnsValidationRecordsInner](docs/Model/V2DomainDnsValidationRecordsInner.md) - [V2DomainRequest](docs/Model/V2DomainRequest.md) - [V2Error](docs/Model/V2Error.md) +- [V2MetricData](docs/Model/V2MetricData.md) +- [V2MetricDataPoint](docs/Model/V2MetricDataPoint.md) +- [V2MetricDataPointTimestamp](docs/Model/V2MetricDataPointTimestamp.md) +- [V2MetricsMeta](docs/Model/V2MetricsMeta.md) +- [V2MetricsResponse](docs/Model/V2MetricsResponse.md) - [V2Organization](docs/Model/V2Organization.md) - [V2OrganizationRequest](docs/Model/V2OrganizationRequest.md) - [V2Project](docs/Model/V2Project.md) @@ -592,7 +777,7 @@ vendor/bin/phpunit This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: `4.9.0` - - Package version: `4.9.0` +- API version: `4.20.0` + - Package version: `4.20.0` - Generator version: `7.13.0` - Build package: `org.openapitools.codegen.languages.PhpClientCodegen` diff --git a/composer.json b/composer.json index 986243d8..ed015511 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "quantcdn/quant-php-client", - "version": "4.9.0", + "version": "4.20.0", "description": "Unified API for QuantCDN Admin and QuantCloud Platform services", "keywords": [ "openapitools", diff --git a/composer.lock b/composer.lock index e229c577..d1a102aa 100644 --- a/composer.lock +++ b/composer.lock @@ -4,29 +4,30 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "19a99b66d2ea6c5b2a893f8f295c1a24", + "content-hash": "63bb2185efeb1ebf840a5186900f553d", "packages": [ { "name": "guzzlehttp/guzzle", - "version": "7.10.0", + "version": "7.14.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4" + "reference": "aef242412e13128b5049864867bb49fc37dd39de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", - "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/aef242412e13128b5049864867bb49fc37dd39de", + "reference": "aef242412e13128b5049864867bb49fc37dd39de", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^2.3", - "guzzlehttp/psr7": "^2.8", + "guzzlehttp/promises": "^2.5.1", + "guzzlehttp/psr7": "^2.12.4", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0" + "symfony/deprecation-contracts": "^2.5 || ^3.0", + "symfony/polyfill-php80": "^1.25" }, "provide": { "psr/http-client-implementation": "1.0" @@ -34,9 +35,10 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "guzzle/client-integration-tests": "3.0.2", + "guzzle/client-integration-tests": "3.0.3", + "guzzlehttp/test-server": "^0.6", "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "phpunit/phpunit": "^8.5.52 || ^9.6.34", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -114,7 +116,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.10.0" + "source": "https://github.com/guzzle/guzzle/tree/7.14.0" }, "funding": [ { @@ -130,28 +132,29 @@ "type": "tidelift" } ], - "time": "2025-08-23T22:36:01+00:00" + "time": "2026-07-08T22:54:09+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.3.0", + "version": "2.5.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "481557b130ef3790cf82b713667b43030dc9c957" + "reference": "9ad1e4fc607446a055b95870c7f668e93b5cff29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957", - "reference": "481557b130ef3790cf82b713667b43030dc9c957", + "url": "https://api.github.com/repos/guzzle/promises/zipball/9ad1e4fc607446a055b95870c7f668e93b5cff29", + "reference": "9ad1e4fc607446a055b95870c7f668e93b5cff29", "shasum": "" }, "require": { - "php": "^7.2.5 || ^8.0" + "php": "^7.2.5 || ^8.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.44 || ^9.6.25" + "phpunit/phpunit": "^8.5.52 || ^9.6.34" }, "type": "library", "extra": { @@ -197,7 +200,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.3.0" + "source": "https://github.com/guzzle/promises/tree/2.5.1" }, "funding": [ { @@ -213,27 +216,29 @@ "type": "tidelift" } ], - "time": "2025-08-22T14:34:08+00:00" + "time": "2026-07-08T15:48:39+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.8.0", + "version": "2.12.4", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "21dc724a0583619cd1652f673303492272778051" + "reference": "51e27f9e2b332ab3e72f4520d5ff4f3c68c3577c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051", - "reference": "21dc724a0583619cd1652f673303492272778051", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/51e27f9e2b332ab3e72f4520d5ff4f3c68c3577c", + "reference": "51e27f9e2b332ab3e72f4520d5ff4f3c68c3577c", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.1 || ^2.0", - "ralouphie/getallheaders": "^3.0" + "ralouphie/getallheaders": "^3.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0", + "symfony/polyfill-php80": "^1.25" }, "provide": { "psr/http-factory-implementation": "1.0", @@ -241,8 +246,9 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "http-interop/http-factory-tests": "0.9.0", - "phpunit/phpunit": "^8.5.44 || ^9.6.25" + "http-interop/http-factory-tests": "1.1.0", + "jshttp/mime-db": "1.54.0.1", + "phpunit/phpunit": "^8.5.52 || ^9.6.34" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -313,7 +319,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.8.0" + "source": "https://github.com/guzzle/psr7/tree/2.12.4" }, "funding": [ { @@ -329,7 +335,7 @@ "type": "tidelift" } ], - "time": "2025-08-23T21:21:41+00:00" + "time": "2026-07-08T15:56:20+00:00" }, { "name": "psr/http-client", @@ -537,16 +543,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.6.0", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", - "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/f3202fa1b5097b0af062dc978b32ecf63404e31d", + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d", "shasum": "" }, "require": { @@ -559,7 +565,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.6-dev" + "dev-main": "3.7-dev" } }, "autoload": { @@ -584,7 +590,91 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-06-05T06:23:12+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.37.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0" }, "funding": [ { @@ -595,12 +685,16 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-25T14:21:43+00:00" + "time": "2026-04-10T16:19:22+00:00" } ], "packages-dev": [ @@ -736,20 +830,19 @@ }, { "name": "nikic/php-parser", - "version": "v5.7.0", + "version": "v5.8.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82" + "reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82", - "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/044a6a392ff8ad0d61f14370a5fbbd0a0107152f", + "reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f", "shasum": "" }, "require": { - "ext-ctype": "*", "ext-json": "*", "ext-tokenizer": "*", "php": ">=7.4" @@ -788,9 +881,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.7.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.8.0" }, - "time": "2025-12-06T11:56:16+00:00" + "time": "2026-07-04T14:30:18+00:00" }, { "name": "phar-io/manifest", @@ -1231,25 +1324,25 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.34", + "version": "9.6.35", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b36f02317466907a230d3aa1d34467041271ef4a" + "reference": "0edba2f3a0c48df3553cb9b640810b30df60302b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b36f02317466907a230d3aa1d34467041271ef4a", - "reference": "b36f02317466907a230d3aa1d34467041271ef4a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0edba2f3a0c48df3553cb9b640810b30df60302b", + "reference": "0edba2f3a0c48df3553cb9b640810b30df60302b", "shasum": "" }, "require": { "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", + "ext-filter": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", - "ext-xml": "*", "ext-xmlwriter": "*", "myclabs/deep-copy": "^1.13.4", "phar-io/manifest": "^2.0.4", @@ -1314,31 +1407,15 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.34" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.35" }, "funding": [ { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - }, - { - "url": "https://liberapay.com/sebastianbergmann", - "type": "liberapay" - }, - { - "url": "https://thanks.dev/u/gh/sebastianbergmann", - "type": "thanks_dev" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" + "url": "https://phpunit.de/sponsoring.html", + "type": "other" } ], - "time": "2026-01-27T05:45:00+00:00" + "time": "2026-07-06T14:48:07+00:00" }, { "name": "sebastian/cli-parser", diff --git a/docs/Api/AIAgentsApi.md b/docs/Api/AIAgentsApi.md index 0108a8b2..a5b0fd7f 100644 --- a/docs/Api/AIAgentsApi.md +++ b/docs/Api/AIAgentsApi.md @@ -7,9 +7,12 @@ All URIs are relative to https://dashboard.quantcdn.io, except if the operation | [**chatWithAIAgent()**](AIAgentsApi.md#chatWithAIAgent) | **POST** /api/v3/organizations/{organisation}/ai/agents/{agentId}/chat | Chat with AI Agent | | [**createAIAgent()**](AIAgentsApi.md#createAIAgent) | **POST** /api/v3/organizations/{organisation}/ai/agents | Create AI Agent | | [**deleteAIAgent()**](AIAgentsApi.md#deleteAIAgent) | **DELETE** /api/v3/organizations/{organisation}/ai/agents/{agentId} | Delete Agent | +| [**deleteAgentOverlay()**](AIAgentsApi.md#deleteAgentOverlay) | **DELETE** /api/v3/organizations/{organisation}/ai/agents/{agentId}/overlay | Delete Agent Overlay | | [**getAIAgent()**](AIAgentsApi.md#getAIAgent) | **GET** /api/v3/organizations/{organisation}/ai/agents/{agentId} | Get Agent Details | +| [**getAgentOverlay()**](AIAgentsApi.md#getAgentOverlay) | **GET** /api/v3/organizations/{organisation}/ai/agents/{agentId}/overlay | Get Agent Overlay | | [**listAIAgents()**](AIAgentsApi.md#listAIAgents) | **GET** /api/v3/organizations/{organisation}/ai/agents | List AI Agents | | [**updateAIAgent()**](AIAgentsApi.md#updateAIAgent) | **PUT** /api/v3/organizations/{organisation}/ai/agents/{agentId} | Update Agent | +| [**upsertAgentOverlay()**](AIAgentsApi.md#upsertAgentOverlay) | **PUT** /api/v3/organizations/{organisation}/ai/agents/{agentId}/overlay | Upsert Agent Overlay | ## `chatWithAIAgent()` @@ -200,6 +203,68 @@ try { [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteAgentOverlay()` + +```php +deleteAgentOverlay($organisation, $agent_id): \QuantClient\Model\DeleteAgentOverlay200Response +``` + +Delete Agent Overlay + +Removes the per-organisation overlay for a global agent, reverting it to platform defaults. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIAgentsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$agent_id = 'agent_id_example'; // string | Global agent identifier + +try { + $result = $apiInstance->deleteAgentOverlay($organisation, $agent_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIAgentsApi->deleteAgentOverlay: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **agent_id** | **string**| Global agent identifier | | + +### Return type + +[**\QuantClient\Model\DeleteAgentOverlay200Response**](../Model/DeleteAgentOverlay200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `getAIAgent()` ```php @@ -262,6 +327,68 @@ try { [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getAgentOverlay()` + +```php +getAgentOverlay($organisation, $agent_id): \QuantClient\Model\GetAgentOverlay200Response +``` + +Get Agent Overlay + +Returns the per-organisation overlay for a global agent, plus base agent metadata for UI context. If no overlay exists the response contains `overlay: null`. Overlays can only be created for global agents. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIAgentsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$agent_id = 'agent_id_example'; // string | Global agent identifier (e.g., 'quantgov-code') + +try { + $result = $apiInstance->getAgentOverlay($organisation, $agent_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIAgentsApi->getAgentOverlay: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **agent_id** | **string**| Global agent identifier (e.g., 'quantgov-code') | | + +### Return type + +[**\QuantClient\Model\GetAgentOverlay200Response**](../Model/GetAgentOverlay200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `listAIAgents()` ```php @@ -387,3 +514,67 @@ try { [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) + +## `upsertAgentOverlay()` + +```php +upsertAgentOverlay($organisation, $agent_id, $upsert_agent_overlay_request): \QuantClient\Model\UpsertAgentOverlay200Response +``` + +Upsert Agent Overlay + +Creates or replaces the per-organisation overlay for a global agent. PUT is full replacement — omitted optional fields are removed. Include `version` from a prior GET to enable compare-and-swap (409 on conflict). Omit for last-writer-wins. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIAgentsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$agent_id = 'agent_id_example'; // string | Global agent identifier +$upsert_agent_overlay_request = new \QuantClient\Model\UpsertAgentOverlayRequest(); // \QuantClient\Model\UpsertAgentOverlayRequest + +try { + $result = $apiInstance->upsertAgentOverlay($organisation, $agent_id, $upsert_agent_overlay_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIAgentsApi->upsertAgentOverlay: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **agent_id** | **string**| Global agent identifier | | +| **upsert_agent_overlay_request** | [**\QuantClient\Model\UpsertAgentOverlayRequest**](../Model/UpsertAgentOverlayRequest.md)| | | + +### Return type + +[**\QuantClient\Model\UpsertAgentOverlay200Response**](../Model/UpsertAgentOverlay200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/AIApi.md b/docs/Api/AIApi.md new file mode 100644 index 00000000..e8cc1518 --- /dev/null +++ b/docs/Api/AIApi.md @@ -0,0 +1,77 @@ +# QuantClient\AIApi + +All URIs are relative to https://dashboard.quantcdn.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getAIUsageStats()**](AIApi.md#getAIUsageStats) | **GET** /api/v3/organizations/{organisation}/ai/usage | Organisation AI usage breakdown (subscription page parity) | + + +## `getAIUsageStats()` + +```php +getAIUsageStats($organisation, $month, $group_by, $include, $user_id, $token_id) +``` + +Organisation AI usage breakdown (subscription page parity) + +AI usage from the subscription page's source (cloud-api monthly-usage). Parameterized by month, groupBy (model|user|token) and optional daily series. NOTE: as of API 4.19.0 this endpoint requires the update_subscription permission + subscription:read scope (previously use_ai_services + ai:use). For per-caller spend use /ai/usage/me. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$month = 'month_example'; // string | YYYY-MM, defaults to current month +$group_by = 'model'; // string +$include = 'include_example'; // string | Set to 'daily' to append a 30-day series +$user_id = 'user_id_example'; // string | Scope the daily series to a user +$token_id = 'token_id_example'; // string | Scope the daily series to a token + +try { + $apiInstance->getAIUsageStats($organisation, $month, $group_by, $include, $user_id, $token_id); +} catch (Exception $e) { + echo 'Exception when calling AIApi->getAIUsageStats: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **month** | **string**| YYYY-MM, defaults to current month | [optional] | +| **group_by** | **string**| | [optional] [default to 'model'] | +| **include** | **string**| Set to 'daily' to append a 30-day series | [optional] | +| **user_id** | **string**| Scope the daily series to a user | [optional] | +| **token_id** | **string**| Scope the daily series to a token | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/AICustomToolsApi.md b/docs/Api/AICustomToolsApi.md index e4ef6f1d..66c79655 100644 --- a/docs/Api/AICustomToolsApi.md +++ b/docs/Api/AICustomToolsApi.md @@ -6,6 +6,7 @@ All URIs are relative to https://dashboard.quantcdn.io, except if the operation | ------------- | ------------- | ------------- | | [**createCustomTool()**](AICustomToolsApi.md#createCustomTool) | **POST** /api/v3/organizations/{organisation}/ai/custom-tools | Register Custom Edge Function Tool | | [**deleteCustomTool()**](AICustomToolsApi.md#deleteCustomTool) | **DELETE** /api/v3/organizations/{organisation}/ai/custom-tools/{toolName} | Delete Custom Tool | +| [**getCustomTool()**](AICustomToolsApi.md#getCustomTool) | **GET** /api/v3/organizations/{organisation}/ai/custom-tools/{toolName} | Get Custom Tool | | [**listCustomTools()**](AICustomToolsApi.md#listCustomTools) | **GET** /api/v3/organizations/{organisation}/ai/custom-tools | List Custom Tools | @@ -17,7 +18,7 @@ createCustomTool($organisation, $create_custom_tool_request): \QuantClient\Model Register Custom Edge Function Tool -Registers a custom edge function as a tool that AI models can invoke. This enables customers to create their own tools backed by edge functions. * * **Edge Function Contract:** * - Edge functions must accept POST requests with JSON payload * - Expected request format: `{ 'toolName': '...', 'input': {...}, 'orgId': '...' }` * - Must return JSON response with either `result` or `error` field * * **Async Tools:** * Set `isAsync: true` for operations >5 seconds. The edge function should return `{ executionId: '...' }` and the AI will poll for completion. +Registers a custom edge function as a tool that AI models can invoke. Provide `edgeFunctionCode` (JavaScript) and the API will deploy it to the CDN, compute the edge function URL, and register the tool. * * **Edge Function Contract:** * - Edge functions must accept POST requests with JSON payload * - Expected request format: `{ 'toolName': '...', 'input': {...}, 'orgId': '...' }` * - Must return JSON response with either `result` or `error` field * * **Idempotent Updates:** * POSTing with the same `name` will update the existing tool — the edge function code is redeployed to the same UUID and the tool registration is updated. * * **Async Tools:** * Set `isAsync: true` for operations >5 seconds. The edge function should return `{ executionId: '...' }` and the AI will poll for completion. ### Example @@ -79,7 +80,7 @@ deleteCustomTool($organisation, $tool_name): \QuantClient\Model\DeleteCustomTool Delete Custom Tool -Deletes a custom tool registration. The underlying edge function is not affected. +Deletes a custom tool registration and its deployed edge function. ### Example @@ -133,6 +134,68 @@ try { [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `getCustomTool()` + +```php +getCustomTool($organisation, $tool_name): \QuantClient\Model\GetCustomTool200Response +``` + +Get Custom Tool + +Retrieves a single registered custom tool by name. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AICustomToolsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$tool_name = 'tool_name_example'; // string | The tool name to retrieve + +try { + $result = $apiInstance->getCustomTool($organisation, $tool_name); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AICustomToolsApi->getCustomTool: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **tool_name** | **string**| The tool name to retrieve | | + +### Return type + +[**\QuantClient\Model\GetCustomTool200Response**](../Model/GetCustomTool200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `listCustomTools()` ```php diff --git a/docs/Api/AIFilterPoliciesApi.md b/docs/Api/AIFilterPoliciesApi.md new file mode 100644 index 00000000..0a558624 --- /dev/null +++ b/docs/Api/AIFilterPoliciesApi.md @@ -0,0 +1,434 @@ +# QuantClient\AIFilterPoliciesApi + +All URIs are relative to https://dashboard.quantcdn.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createFilterPolicy()**](AIFilterPoliciesApi.md#createFilterPolicy) | **POST** /api/v3/organizations/{organisation}/ai/filter-policies | Create an AI filter policy for an organisation | +| [**deleteFilterPolicy()**](AIFilterPoliciesApi.md#deleteFilterPolicy) | **DELETE** /api/v3/organizations/{organisation}/ai/filter-policies/{policyId} | Delete a specific AI filter policy | +| [**disableFilterPolicy()**](AIFilterPoliciesApi.md#disableFilterPolicy) | **PUT** /api/v3/organizations/{organisation}/ai/filter-policies/{policyId}/disable | Disable a specific AI filter policy | +| [**enableFilterPolicy()**](AIFilterPoliciesApi.md#enableFilterPolicy) | **PUT** /api/v3/organizations/{organisation}/ai/filter-policies/{policyId}/enable | Enable a specific AI filter policy | +| [**getFilterPolicy()**](AIFilterPoliciesApi.md#getFilterPolicy) | **GET** /api/v3/organizations/{organisation}/ai/filter-policies/{policyId} | Get a specific AI filter policy | +| [**listFilterPolicies()**](AIFilterPoliciesApi.md#listFilterPolicies) | **GET** /api/v3/organizations/{organisation}/ai/filter-policies | List AI filter policies for an organisation | +| [**updateFilterPolicy()**](AIFilterPoliciesApi.md#updateFilterPolicy) | **PUT** /api/v3/organizations/{organisation}/ai/filter-policies/{policyId} | Update a specific AI filter policy | + + +## `createFilterPolicy()` + +```php +createFilterPolicy($organisation, $create_filter_policy_request): object +``` + +Create an AI filter policy for an organisation + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIFilterPoliciesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$create_filter_policy_request = new \QuantClient\Model\CreateFilterPolicyRequest(); // \QuantClient\Model\CreateFilterPolicyRequest + +try { + $result = $apiInstance->createFilterPolicy($organisation, $create_filter_policy_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIFilterPoliciesApi->createFilterPolicy: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **create_filter_policy_request** | [**\QuantClient\Model\CreateFilterPolicyRequest**](../Model/CreateFilterPolicyRequest.md)| | | + +### Return type + +**object** + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteFilterPolicy()` + +```php +deleteFilterPolicy($organisation, $policy_id): object +``` + +Delete a specific AI filter policy + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIFilterPoliciesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$policy_id = 'policy_id_example'; // string + +try { + $result = $apiInstance->deleteFilterPolicy($organisation, $policy_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIFilterPoliciesApi->deleteFilterPolicy: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **policy_id** | **string**| | | + +### Return type + +**object** + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `disableFilterPolicy()` + +```php +disableFilterPolicy($organisation, $policy_id): object +``` + +Disable a specific AI filter policy + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIFilterPoliciesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$policy_id = 'policy_id_example'; // string + +try { + $result = $apiInstance->disableFilterPolicy($organisation, $policy_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIFilterPoliciesApi->disableFilterPolicy: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **policy_id** | **string**| | | + +### Return type + +**object** + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `enableFilterPolicy()` + +```php +enableFilterPolicy($organisation, $policy_id): object +``` + +Enable a specific AI filter policy + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIFilterPoliciesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$policy_id = 'policy_id_example'; // string + +try { + $result = $apiInstance->enableFilterPolicy($organisation, $policy_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIFilterPoliciesApi->enableFilterPolicy: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **policy_id** | **string**| | | + +### Return type + +**object** + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getFilterPolicy()` + +```php +getFilterPolicy($organisation, $policy_id): object +``` + +Get a specific AI filter policy + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIFilterPoliciesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$policy_id = 'policy_id_example'; // string + +try { + $result = $apiInstance->getFilterPolicy($organisation, $policy_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIFilterPoliciesApi->getFilterPolicy: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **policy_id** | **string**| | | + +### Return type + +**object** + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listFilterPolicies()` + +```php +listFilterPolicies($organisation): object +``` + +List AI filter policies for an organisation + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIFilterPoliciesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID + +try { + $result = $apiInstance->listFilterPolicies($organisation); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIFilterPoliciesApi->listFilterPolicies: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | + +### Return type + +**object** + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateFilterPolicy()` + +```php +updateFilterPolicy($organisation, $policy_id, $update_filter_policy_request): object +``` + +Update a specific AI filter policy + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIFilterPoliciesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$policy_id = 'policy_id_example'; // string +$update_filter_policy_request = new \QuantClient\Model\UpdateFilterPolicyRequest(); // \QuantClient\Model\UpdateFilterPolicyRequest + +try { + $result = $apiInstance->updateFilterPolicy($organisation, $policy_id, $update_filter_policy_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIFilterPoliciesApi->updateFilterPolicy: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **policy_id** | **string**| | | +| **update_filter_policy_request** | [**\QuantClient\Model\UpdateFilterPolicyRequest**](../Model/UpdateFilterPolicyRequest.md)| | | + +### Return type + +**object** + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/AIGovernanceApi.md b/docs/Api/AIGovernanceApi.md new file mode 100644 index 00000000..14cb103e --- /dev/null +++ b/docs/Api/AIGovernanceApi.md @@ -0,0 +1,186 @@ +# QuantClient\AIGovernanceApi + +All URIs are relative to https://dashboard.quantcdn.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getGovernanceConfig()**](AIGovernanceApi.md#getGovernanceConfig) | **GET** /api/v3/organizations/{organisation}/ai/governance | Get AI governance configuration for an organisation | +| [**getGovernanceSpend()**](AIGovernanceApi.md#getGovernanceSpend) | **GET** /api/v3/organizations/{organisation}/ai/governance/spend | Get AI spend summary for an organisation | +| [**updateGovernanceConfig()**](AIGovernanceApi.md#updateGovernanceConfig) | **PUT** /api/v3/organizations/{organisation}/ai/governance | Update AI governance configuration for an organisation | + + +## `getGovernanceConfig()` + +```php +getGovernanceConfig($organisation): \QuantClient\Model\GetGovernanceConfig200Response +``` + +Get AI governance configuration for an organisation + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIGovernanceApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID + +try { + $result = $apiInstance->getGovernanceConfig($organisation); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIGovernanceApi->getGovernanceConfig: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | + +### Return type + +[**\QuantClient\Model\GetGovernanceConfig200Response**](../Model/GetGovernanceConfig200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getGovernanceSpend()` + +```php +getGovernanceSpend($organisation): \QuantClient\Model\GetGovernanceSpend200Response +``` + +Get AI spend summary for an organisation + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIGovernanceApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID + +try { + $result = $apiInstance->getGovernanceSpend($organisation); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIGovernanceApi->getGovernanceSpend: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | + +### Return type + +[**\QuantClient\Model\GetGovernanceSpend200Response**](../Model/GetGovernanceSpend200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateGovernanceConfig()` + +```php +updateGovernanceConfig($organisation, $update_governance_config_request): \QuantClient\Model\UpdateGovernanceConfig200Response +``` + +Update AI governance configuration for an organisation + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIGovernanceApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$update_governance_config_request = new \QuantClient\Model\UpdateGovernanceConfigRequest(); // \QuantClient\Model\UpdateGovernanceConfigRequest + +try { + $result = $apiInstance->updateGovernanceConfig($organisation, $update_governance_config_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIGovernanceApi->updateGovernanceConfig: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **update_governance_config_request** | [**\QuantClient\Model\UpdateGovernanceConfigRequest**](../Model/UpdateGovernanceConfigRequest.md)| | | + +### Return type + +[**\QuantClient\Model\UpdateGovernanceConfig200Response**](../Model/UpdateGovernanceConfig200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/AIOrchestrationsApi.md b/docs/Api/AIOrchestrationsApi.md new file mode 100644 index 00000000..b11d67b4 --- /dev/null +++ b/docs/Api/AIOrchestrationsApi.md @@ -0,0 +1,581 @@ +# QuantClient\AIOrchestrationsApi + +All URIs are relative to https://dashboard.quantcdn.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**cancelOrchestration()**](AIOrchestrationsApi.md#cancelOrchestration) | **POST** /api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}/cancel | Cancel Durable Orchestration | +| [**createOrchestration()**](AIOrchestrationsApi.md#createOrchestration) | **POST** /api/v3/organizations/{organisation}/ai/orchestrations | Create Durable Orchestration | +| [**deleteOrchestration()**](AIOrchestrationsApi.md#deleteOrchestration) | **DELETE** /api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId} | Delete Durable Orchestration | +| [**getOrchestration()**](AIOrchestrationsApi.md#getOrchestration) | **GET** /api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId} | Get Durable Orchestration | +| [**listOrchestrationBatches()**](AIOrchestrationsApi.md#listOrchestrationBatches) | **GET** /api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}/batches | List Orchestration Batches | +| [**listOrchestrations()**](AIOrchestrationsApi.md#listOrchestrations) | **GET** /api/v3/organizations/{organisation}/ai/orchestrations | List Durable Orchestrations | +| [**pauseOrchestration()**](AIOrchestrationsApi.md#pauseOrchestration) | **POST** /api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}/pause | Pause Durable Orchestration | +| [**resumeOrchestration()**](AIOrchestrationsApi.md#resumeOrchestration) | **POST** /api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}/resume | Resume Durable Orchestration | +| [**startOrchestration()**](AIOrchestrationsApi.md#startOrchestration) | **POST** /api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}/start | Start Durable Orchestration | + + +## `cancelOrchestration()` + +```php +cancelOrchestration($organisation, $orchestration_id): object +``` + +Cancel Durable Orchestration + +Cancel an orchestration permanently. Cannot be resumed. Any in-progress items will complete, but no new processing starts. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIOrchestrationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation machine name +$orchestration_id = 'orchestration_id_example'; // string | Orchestration identifier + +try { + $result = $apiInstance->cancelOrchestration($organisation, $orchestration_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIOrchestrationsApi->cancelOrchestration: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation machine name | | +| **orchestration_id** | **string**| Orchestration identifier | | + +### Return type + +**object** + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createOrchestration()` + +```php +createOrchestration($organisation, $create_orchestration_request): object +``` + +Create Durable Orchestration + +Create a new durable orchestration for batch processing. * * **Input Sources:** * - `static`: Process a fixed list of items * - `task_query`: Process tasks matching a query * - `generator`: AI generates items from a prompt * * **Stop Conditions:** * - `all_complete`: Stop when all items processed * - `max_iterations`: Stop after N iterations * - `condition`: AI evaluates a prompt to decide * - `manual`: Run until manually stopped * * **Auto-start:** * By default, the orchestration starts immediately. Set `autoStart: false` to create in pending state. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIOrchestrationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation machine name +$create_orchestration_request = new \QuantClient\Model\CreateOrchestrationRequest(); // \QuantClient\Model\CreateOrchestrationRequest + +try { + $result = $apiInstance->createOrchestration($organisation, $create_orchestration_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIOrchestrationsApi->createOrchestration: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation machine name | | +| **create_orchestration_request** | [**\QuantClient\Model\CreateOrchestrationRequest**](../Model/CreateOrchestrationRequest.md)| | | + +### Return type + +**object** + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteOrchestration()` + +```php +deleteOrchestration($organisation, $orchestration_id) +``` + +Delete Durable Orchestration + +Delete an orchestration. Can only delete orchestrations in completed, failed, or cancelled status. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIOrchestrationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation machine name +$orchestration_id = 'orchestration_id_example'; // string | Orchestration identifier + +try { + $apiInstance->deleteOrchestration($organisation, $orchestration_id); +} catch (Exception $e) { + echo 'Exception when calling AIOrchestrationsApi->deleteOrchestration: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation machine name | | +| **orchestration_id** | **string**| Orchestration identifier | | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOrchestration()` + +```php +getOrchestration($organisation, $orchestration_id): object +``` + +Get Durable Orchestration + +Get orchestration details including status and progress. * * **Progress Tracking:** * - `total`: Total items to process * - `completed`: Successfully processed * - `failed`: Failed processing * - `pending`: Awaiting processing + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIOrchestrationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation machine name +$orchestration_id = orch_1704067200_abc123xyz; // string | Orchestration identifier + +try { + $result = $apiInstance->getOrchestration($organisation, $orchestration_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIOrchestrationsApi->getOrchestration: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation machine name | | +| **orchestration_id** | **string**| Orchestration identifier | | + +### Return type + +**object** + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listOrchestrationBatches()` + +```php +listOrchestrationBatches($organisation, $orchestration_id, $limit, $cursor): \QuantClient\Model\ListOrchestrationBatches200Response +``` + +List Orchestration Batches + +Get history of batches processed by this orchestration. Returns paginated batch records with status and item counts. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIOrchestrationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation machine name +$orchestration_id = 'orchestration_id_example'; // string | Orchestration identifier +$limit = 20; // int | Maximum number of batches to return +$cursor = 'cursor_example'; // string | Pagination cursor from previous response + +try { + $result = $apiInstance->listOrchestrationBatches($organisation, $orchestration_id, $limit, $cursor); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIOrchestrationsApi->listOrchestrationBatches: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation machine name | | +| **orchestration_id** | **string**| Orchestration identifier | | +| **limit** | **int**| Maximum number of batches to return | [optional] [default to 20] | +| **cursor** | **string**| Pagination cursor from previous response | [optional] | + +### Return type + +[**\QuantClient\Model\ListOrchestrationBatches200Response**](../Model/ListOrchestrationBatches200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listOrchestrations()` + +```php +listOrchestrations($organisation, $status, $limit, $cursor): \QuantClient\Model\ListOrchestrations200Response +``` + +List Durable Orchestrations + +List durable orchestrations for an organization with optional filtering. * * **Note:** This is different from `/tools/orchestrations` which handles async tool execution * polling. These durable orchestrations are for long-running batch processing loops. * * **Filter Options:** * - `status`: Filter by orchestration status * - `limit`: Max results (default 20, max 100) * - `cursor`: Pagination cursor + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIOrchestrationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation machine name +$status = 'status_example'; // string | Filter by orchestration status +$limit = 20; // int | Maximum number of results +$cursor = 'cursor_example'; // string | Pagination cursor from previous response + +try { + $result = $apiInstance->listOrchestrations($organisation, $status, $limit, $cursor); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIOrchestrationsApi->listOrchestrations: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation machine name | | +| **status** | **string**| Filter by orchestration status | [optional] | +| **limit** | **int**| Maximum number of results | [optional] [default to 20] | +| **cursor** | **string**| Pagination cursor from previous response | [optional] | + +### Return type + +[**\QuantClient\Model\ListOrchestrations200Response**](../Model/ListOrchestrations200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `pauseOrchestration()` + +```php +pauseOrchestration($organisation, $orchestration_id): object +``` + +Pause Durable Orchestration + +Pause a running orchestration. The current batch will complete, but no new batches will start. Can be resumed later. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIOrchestrationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation machine name +$orchestration_id = 'orchestration_id_example'; // string | Orchestration identifier + +try { + $result = $apiInstance->pauseOrchestration($organisation, $orchestration_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIOrchestrationsApi->pauseOrchestration: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation machine name | | +| **orchestration_id** | **string**| Orchestration identifier | | + +### Return type + +**object** + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `resumeOrchestration()` + +```php +resumeOrchestration($organisation, $orchestration_id): object +``` + +Resume Durable Orchestration + +Resume a paused orchestration. Processing continues from where it left off. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIOrchestrationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation machine name +$orchestration_id = 'orchestration_id_example'; // string | Orchestration identifier + +try { + $result = $apiInstance->resumeOrchestration($organisation, $orchestration_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIOrchestrationsApi->resumeOrchestration: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation machine name | | +| **orchestration_id** | **string**| Orchestration identifier | | + +### Return type + +**object** + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `startOrchestration()` + +```php +startOrchestration($organisation, $orchestration_id): object +``` + +Start Durable Orchestration + +Start a pending orchestration. Only works on orchestrations created with `autoStart: false`. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIOrchestrationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation machine name +$orchestration_id = 'orchestration_id_example'; // string | Orchestration identifier + +try { + $result = $apiInstance->startOrchestration($organisation, $orchestration_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIOrchestrationsApi->startOrchestration: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation machine name | | +| **orchestration_id** | **string**| Orchestration identifier | | + +### Return type + +**object** + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/AISearchApi.md b/docs/Api/AISearchApi.md new file mode 100644 index 00000000..6f83f6d2 --- /dev/null +++ b/docs/Api/AISearchApi.md @@ -0,0 +1,1065 @@ +# QuantClient\AISearchApi + +All URIs are relative to https://dashboard.quantcdn.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**aiSearchChat()**](AISearchApi.md#aiSearchChat) | **POST** /api/v3/organisations/{organisation}/projects/{project}/ai-search/chat | RAG chat with AI Search content | +| [**aiSearchDeletePages()**](AISearchApi.md#aiSearchDeletePages) | **DELETE** /api/v3/organisations/{organisation}/projects/{project}/ai-search/pages | Delete pages by URLs or patterns | +| [**aiSearchDisable()**](AISearchApi.md#aiSearchDisable) | **POST** /api/v3/organisations/{organisation}/projects/{project}/ai-search/disable | Disable AI Search for a project | +| [**aiSearchEnable()**](AISearchApi.md#aiSearchEnable) | **POST** /api/v3/organisations/{organisation}/projects/{project}/ai-search/enable | Enable AI Search for a project | +| [**aiSearchGetCrawl()**](AISearchApi.md#aiSearchGetCrawl) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search/crawls/{jobId} | Get AI Search ingest job status | +| [**aiSearchGetCrawlPages()**](AISearchApi.md#aiSearchGetCrawlPages) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search/crawls/{jobId}/pages | Get per-page ingest results for a crawl job | +| [**aiSearchGetSettings()**](AISearchApi.md#aiSearchGetSettings) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search/settings | Get AI Search public access and rate limit settings | +| [**aiSearchIngestPages()**](AISearchApi.md#aiSearchIngestPages) | **POST** /api/v3/organisations/{organisation}/projects/{project}/ai-search/pages | Ingest pages into the AI Search index | +| [**aiSearchListCrawls()**](AISearchApi.md#aiSearchListCrawls) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search/crawls | List AI Search ingest jobs | +| [**aiSearchListPages()**](AISearchApi.md#aiSearchListPages) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search/pages | List indexed pages with cursor pagination | +| [**aiSearchPurgeIndex()**](AISearchApi.md#aiSearchPurgeIndex) | **DELETE** /api/v3/organisations/{organisation}/projects/{project}/ai-search/index | Purge the entire AI Search index | +| [**aiSearchSearch()**](AISearchApi.md#aiSearchSearch) | **POST** /api/v3/organisations/{organisation}/projects/{project}/ai-search/search | Semantic search across the AI Search index | +| [**aiSearchStatus()**](AISearchApi.md#aiSearchStatus) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search | Get AI Search status for a project | +| [**aiSearchTopQueries()**](AISearchApi.md#aiSearchTopQueries) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search/top-queries | Get the most popular AI Search queries | +| [**aiSearchTriggerCrawl()**](AISearchApi.md#aiSearchTriggerCrawl) | **POST** /api/v3/organisations/{organisation}/projects/{project}/ai-search/crawls | Trigger a crawler run that ingests into AI Search | +| [**aiSearchUpdateSettings()**](AISearchApi.md#aiSearchUpdateSettings) | **PUT** /api/v3/organisations/{organisation}/projects/{project}/ai-search/settings | Update AI Search public access and rate limit settings | +| [**aiSearchUsage()**](AISearchApi.md#aiSearchUsage) | **GET** /api/v3/organisations/{organisation}/projects/{project}/ai-search/usage | Get usage statistics for the AI Search site | + + +## `aiSearchChat()` + +```php +aiSearchChat($organisation, $project, $ai_search_chat_request) +``` + +RAG chat with AI Search content + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string +$ai_search_chat_request = new \QuantClient\Model\AiSearchChatRequest(); // \QuantClient\Model\AiSearchChatRequest + +try { + $apiInstance->aiSearchChat($organisation, $project, $ai_search_chat_request); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchChat: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | +| **ai_search_chat_request** | [**\QuantClient\Model\AiSearchChatRequest**](../Model/AiSearchChatRequest.md)| | | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchDeletePages()` + +```php +aiSearchDeletePages($organisation, $project, $ai_search_delete_pages_request) +``` + +Delete pages by URLs or patterns + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string +$ai_search_delete_pages_request = new \QuantClient\Model\AiSearchDeletePagesRequest(); // \QuantClient\Model\AiSearchDeletePagesRequest + +try { + $apiInstance->aiSearchDeletePages($organisation, $project, $ai_search_delete_pages_request); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchDeletePages: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | +| **ai_search_delete_pages_request** | [**\QuantClient\Model\AiSearchDeletePagesRequest**](../Model/AiSearchDeletePagesRequest.md)| | | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchDisable()` + +```php +aiSearchDisable($organisation, $project) +``` + +Disable AI Search for a project + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string + +try { + $apiInstance->aiSearchDisable($organisation, $project); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchDisable: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchEnable()` + +```php +aiSearchEnable($organisation, $project, $ai_search_enable_request) +``` + +Enable AI Search for a project + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string +$ai_search_enable_request = new \QuantClient\Model\AiSearchEnableRequest(); // \QuantClient\Model\AiSearchEnableRequest + +try { + $apiInstance->aiSearchEnable($organisation, $project, $ai_search_enable_request); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchEnable: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | +| **ai_search_enable_request** | [**\QuantClient\Model\AiSearchEnableRequest**](../Model/AiSearchEnableRequest.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchGetCrawl()` + +```php +aiSearchGetCrawl($organisation, $project, $job_id) +``` + +Get AI Search ingest job status + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string +$job_id = 'job_id_example'; // string + +try { + $apiInstance->aiSearchGetCrawl($organisation, $project, $job_id); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchGetCrawl: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | +| **job_id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchGetCrawlPages()` + +```php +aiSearchGetCrawlPages($organisation, $project, $job_id, $limit, $status_code, $processing_status) +``` + +Get per-page ingest results for a crawl job + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string +$job_id = 'job_id_example'; // string +$limit = 56; // int +$status_code = 56; // int +$processing_status = 'processing_status_example'; // string + +try { + $apiInstance->aiSearchGetCrawlPages($organisation, $project, $job_id, $limit, $status_code, $processing_status); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchGetCrawlPages: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | +| **job_id** | **string**| | | +| **limit** | **int**| | [optional] | +| **status_code** | **int**| | [optional] | +| **processing_status** | **string**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchGetSettings()` + +```php +aiSearchGetSettings($organisation, $project) +``` + +Get AI Search public access and rate limit settings + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string + +try { + $apiInstance->aiSearchGetSettings($organisation, $project); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchGetSettings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchIngestPages()` + +```php +aiSearchIngestPages($organisation, $project, $ai_search_ingest_pages_request) +``` + +Ingest pages into the AI Search index + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string +$ai_search_ingest_pages_request = new \QuantClient\Model\AiSearchIngestPagesRequest(); // \QuantClient\Model\AiSearchIngestPagesRequest + +try { + $apiInstance->aiSearchIngestPages($organisation, $project, $ai_search_ingest_pages_request); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchIngestPages: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | +| **ai_search_ingest_pages_request** | [**\QuantClient\Model\AiSearchIngestPagesRequest**](../Model/AiSearchIngestPagesRequest.md)| | | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchListCrawls()` + +```php +aiSearchListCrawls($organisation, $project, $limit) +``` + +List AI Search ingest jobs + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string +$limit = 56; // int + +try { + $apiInstance->aiSearchListCrawls($organisation, $project, $limit); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchListCrawls: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | +| **limit** | **int**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchListPages()` + +```php +aiSearchListPages($organisation, $project, $limit, $cursor, $search) +``` + +List indexed pages with cursor pagination + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string +$limit = 56; // int +$cursor = 'cursor_example'; // string +$search = 'search_example'; // string + +try { + $apiInstance->aiSearchListPages($organisation, $project, $limit, $cursor, $search); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchListPages: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | +| **limit** | **int**| | [optional] | +| **cursor** | **string**| | [optional] | +| **search** | **string**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchPurgeIndex()` + +```php +aiSearchPurgeIndex($organisation, $project) +``` + +Purge the entire AI Search index + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string + +try { + $apiInstance->aiSearchPurgeIndex($organisation, $project); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchPurgeIndex: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchSearch()` + +```php +aiSearchSearch($organisation, $project, $ai_search_search_request) +``` + +Semantic search across the AI Search index + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string +$ai_search_search_request = new \QuantClient\Model\AiSearchSearchRequest(); // \QuantClient\Model\AiSearchSearchRequest + +try { + $apiInstance->aiSearchSearch($organisation, $project, $ai_search_search_request); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchSearch: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | +| **ai_search_search_request** | [**\QuantClient\Model\AiSearchSearchRequest**](../Model/AiSearchSearchRequest.md)| | | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchStatus()` + +```php +aiSearchStatus($organisation, $project) +``` + +Get AI Search status for a project + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string + +try { + $apiInstance->aiSearchStatus($organisation, $project); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchTopQueries()` + +```php +aiSearchTopQueries($organisation, $project, $range, $limit) +``` + +Get the most popular AI Search queries + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string +$range = '30d'; // string +$limit = 56; // int + +try { + $apiInstance->aiSearchTopQueries($organisation, $project, $range, $limit); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchTopQueries: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | +| **range** | **string**| | [optional] [default to '30d'] | +| **limit** | **int**| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchTriggerCrawl()` + +```php +aiSearchTriggerCrawl($organisation, $project, $ai_search_trigger_crawl_request) +``` + +Trigger a crawler run that ingests into AI Search + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string +$ai_search_trigger_crawl_request = new \QuantClient\Model\AiSearchTriggerCrawlRequest(); // \QuantClient\Model\AiSearchTriggerCrawlRequest + +try { + $apiInstance->aiSearchTriggerCrawl($organisation, $project, $ai_search_trigger_crawl_request); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchTriggerCrawl: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | +| **ai_search_trigger_crawl_request** | [**\QuantClient\Model\AiSearchTriggerCrawlRequest**](../Model/AiSearchTriggerCrawlRequest.md)| | | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchUpdateSettings()` + +```php +aiSearchUpdateSettings($organisation, $project, $ai_search_update_settings_request) +``` + +Update AI Search public access and rate limit settings + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string +$ai_search_update_settings_request = new \QuantClient\Model\AiSearchUpdateSettingsRequest(); // \QuantClient\Model\AiSearchUpdateSettingsRequest + +try { + $apiInstance->aiSearchUpdateSettings($organisation, $project, $ai_search_update_settings_request); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchUpdateSettings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | +| **ai_search_update_settings_request** | [**\QuantClient\Model\AiSearchUpdateSettingsRequest**](../Model/AiSearchUpdateSettingsRequest.md)| | | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `aiSearchUsage()` + +```php +aiSearchUsage($organisation, $project, $range) +``` + +Get usage statistics for the AI Search site + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$project = 'project_example'; // string +$range = '30d'; // string + +try { + $apiInstance->aiSearchUsage($organisation, $project, $range); +} catch (Exception $e) { + echo 'Exception when calling AISearchApi->aiSearchUsage: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **project** | **string**| | | +| **range** | **string**| | [optional] [default to '30d'] | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/AISkillsApi.md b/docs/Api/AISkillsApi.md new file mode 100644 index 00000000..dc2e8789 --- /dev/null +++ b/docs/Api/AISkillsApi.md @@ -0,0 +1,704 @@ +# QuantClient\AISkillsApi + +All URIs are relative to https://dashboard.quantcdn.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createSkill()**](AISkillsApi.md#createSkill) | **POST** /api/v3/organizations/{organisation}/ai/skills | Create Inline Skill | +| [**deleteSkill()**](AISkillsApi.md#deleteSkill) | **DELETE** /api/v3/organizations/{organisation}/ai/skills/{skillId} | Delete Skill | +| [**deleteSkillCollection()**](AISkillsApi.md#deleteSkillCollection) | **DELETE** /api/v3/organizations/{organisation}/ai/skills/collections/{namespace} | Delete Skill Collection | +| [**getSkill()**](AISkillsApi.md#getSkill) | **GET** /api/v3/organizations/{organisation}/ai/skills/{skillId} | Get Skill Details | +| [**importSkill()**](AISkillsApi.md#importSkill) | **POST** /api/v3/organizations/{organisation}/ai/skills/import | Import Skill from External Source | +| [**importSkillCollection()**](AISkillsApi.md#importSkillCollection) | **POST** /api/v3/organizations/{organisation}/ai/skills/import-collection | Import Skill Collection from GitHub | +| [**listSkillCollections()**](AISkillsApi.md#listSkillCollections) | **GET** /api/v3/organizations/{organisation}/ai/skills/collections | List Skill Collections | +| [**listSkills()**](AISkillsApi.md#listSkills) | **GET** /api/v3/organizations/{organisation}/ai/skills | List Organization's Skills | +| [**syncSkill()**](AISkillsApi.md#syncSkill) | **POST** /api/v3/organizations/{organisation}/ai/skills/{skillId}/sync | Sync Skill from Source | +| [**syncSkillCollection()**](AISkillsApi.md#syncSkillCollection) | **POST** /api/v3/organizations/{organisation}/ai/skills/collections/{namespace}/sync | Sync Skill Collection | +| [**updateSkill()**](AISkillsApi.md#updateSkill) | **PUT** /api/v3/organizations/{organisation}/ai/skills/{skillId} | Update Skill | + + +## `createSkill()` + +```php +createSkill($organisation, $create_skill_request): \QuantClient\Model\CreateSkill201Response +``` + +Create Inline Skill + +Creates a new skill with inline content. Use this for custom skills * that are defined directly in your organization. * * **Trigger Conditions:** * - Natural language description of when to use the skill * - Used by AI to determine when to suggest or apply the skill * - Example: 'When the user asks about code review or security analysis' + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISkillsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$create_skill_request = new \QuantClient\Model\CreateSkillRequest(); // \QuantClient\Model\CreateSkillRequest + +try { + $result = $apiInstance->createSkill($organisation, $create_skill_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISkillsApi->createSkill: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **create_skill_request** | [**\QuantClient\Model\CreateSkillRequest**](../Model/CreateSkillRequest.md)| | | + +### Return type + +[**\QuantClient\Model\CreateSkill201Response**](../Model/CreateSkill201Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteSkill()` + +```php +deleteSkill($organisation, $skill_id): \QuantClient\Model\DeleteSkill200Response +``` + +Delete Skill + +Permanently deletes a skill. This will also remove it from any agents that have it assigned. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISkillsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$skill_id = 'skill_id_example'; // string | The skill ID + +try { + $result = $apiInstance->deleteSkill($organisation, $skill_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISkillsApi->deleteSkill: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **skill_id** | **string**| The skill ID | | + +### Return type + +[**\QuantClient\Model\DeleteSkill200Response**](../Model/DeleteSkill200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteSkillCollection()` + +```php +deleteSkillCollection($organisation, $namespace): \QuantClient\Model\DeleteSkillCollection200Response +``` + +Delete Skill Collection + +Permanently deletes all skills in the specified namespace. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISkillsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$namespace = 'namespace_example'; // string | Collection namespace + +try { + $result = $apiInstance->deleteSkillCollection($organisation, $namespace); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISkillsApi->deleteSkillCollection: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **namespace** | **string**| Collection namespace | | + +### Return type + +[**\QuantClient\Model\DeleteSkillCollection200Response**](../Model/DeleteSkillCollection200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSkill()` + +```php +getSkill($organisation, $skill_id): \QuantClient\Model\GetSkill200Response +``` + +Get Skill Details + +Retrieves full details of a skill including its content, source information, and metadata. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISkillsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$skill_id = 'skill_id_example'; // string | The skill ID + +try { + $result = $apiInstance->getSkill($organisation, $skill_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISkillsApi->getSkill: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **skill_id** | **string**| The skill ID | | + +### Return type + +[**\QuantClient\Model\GetSkill200Response**](../Model/GetSkill200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importSkill()` + +```php +importSkill($organisation, $import_skill_request): \QuantClient\Model\ImportSkill201Response +``` + +Import Skill from External Source + +Imports a skill from an external source like skills.sh registry or GitHub repository. * * **Supported Sources:** * - `skills.sh`: Import from the skills.sh community registry * - `github`: Import from a GitHub repository (public or private) * * **Version Control:** * - Skills can be pinned to specific versions * - Use the sync endpoint to update to latest version + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISkillsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$import_skill_request = new \QuantClient\Model\ImportSkillRequest(); // \QuantClient\Model\ImportSkillRequest + +try { + $result = $apiInstance->importSkill($organisation, $import_skill_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISkillsApi->importSkill: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **import_skill_request** | [**\QuantClient\Model\ImportSkillRequest**](../Model/ImportSkillRequest.md)| | | + +### Return type + +[**\QuantClient\Model\ImportSkill201Response**](../Model/ImportSkill201Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `importSkillCollection()` + +```php +importSkillCollection($organisation, $import_skill_collection_request): \QuantClient\Model\ImportSkillCollection201Response +``` + +Import Skill Collection from GitHub + +Discovers all skill directories under a given path in a GitHub repository * and imports each as a skill within the specified namespace. Each subdirectory must contain a SKILL.md file. * * **Namespace:** Used for grouping and slash-command invocation (e.g., `/superpowers:brainstorming`). * * **Idempotent:** If a skill with the same namespace + name already exists, it is updated. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISkillsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$import_skill_collection_request = new \QuantClient\Model\ImportSkillCollectionRequest(); // \QuantClient\Model\ImportSkillCollectionRequest + +try { + $result = $apiInstance->importSkillCollection($organisation, $import_skill_collection_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISkillsApi->importSkillCollection: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **import_skill_collection_request** | [**\QuantClient\Model\ImportSkillCollectionRequest**](../Model/ImportSkillCollectionRequest.md)| | | + +### Return type + +[**\QuantClient\Model\ImportSkillCollection201Response**](../Model/ImportSkillCollection201Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listSkillCollections()` + +```php +listSkillCollections($organisation): \QuantClient\Model\ListSkillCollections200Response +``` + +List Skill Collections + +Lists distinct namespaces (collections) for the organization, with skill counts and skill names for each collection. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISkillsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID + +try { + $result = $apiInstance->listSkillCollections($organisation); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISkillsApi->listSkillCollections: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | + +### Return type + +[**\QuantClient\Model\ListSkillCollections200Response**](../Model/ListSkillCollections200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listSkills()` + +```php +listSkills($organisation, $tag, $namespace, $limit): \QuantClient\Model\ListSkills200Response +``` + +List Organization's Skills + +Lists all skills available to the organization. Skills are reusable prompts, * workflows, or instructions that can be assigned to agents or invoked directly. * * **Skill Sources:** * - `inline`: Created directly via the API * - `skills.sh`: Imported from skills.sh registry * - `github`: Imported from a GitHub repository * - `local`: Uploaded from local file + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISkillsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$tag = 'tag_example'; // string | Filter skills by tag +$namespace = 'namespace_example'; // string | Filter skills by collection namespace (e.g. 'superpowers') +$limit = 50; // int | Maximum number of skills to return + +try { + $result = $apiInstance->listSkills($organisation, $tag, $namespace, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISkillsApi->listSkills: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **tag** | **string**| Filter skills by tag | [optional] | +| **namespace** | **string**| Filter skills by collection namespace (e.g. 'superpowers') | [optional] | +| **limit** | **int**| Maximum number of skills to return | [optional] [default to 50] | + +### Return type + +[**\QuantClient\Model\ListSkills200Response**](../Model/ListSkills200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `syncSkill()` + +```php +syncSkill($organisation, $skill_id): \QuantClient\Model\ImportSkill201Response +``` + +Sync Skill from Source + +Re-fetches skill content from its original source. * Only applicable to skills imported from external sources (skills.sh, github). * Inline skills cannot be synced. * * **Version Behavior:** * - If version is pinned, fetches that specific version * - If no version specified, fetches latest + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISkillsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$skill_id = 'skill_id_example'; // string | The skill ID + +try { + $result = $apiInstance->syncSkill($organisation, $skill_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISkillsApi->syncSkill: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **skill_id** | **string**| The skill ID | | + +### Return type + +[**\QuantClient\Model\ImportSkill201Response**](../Model/ImportSkill201Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `syncSkillCollection()` + +```php +syncSkillCollection($organisation, $namespace): \QuantClient\Model\SyncSkillCollection200Response +``` + +Sync Skill Collection + +Re-syncs all skills in a namespace from their GitHub source. Detects new * skills added to the repository and flags skills removed from the source. Does NOT auto-delete removed skills. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISkillsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$namespace = 'namespace_example'; // string | Collection namespace + +try { + $result = $apiInstance->syncSkillCollection($organisation, $namespace); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISkillsApi->syncSkillCollection: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **namespace** | **string**| Collection namespace | | + +### Return type + +[**\QuantClient\Model\SyncSkillCollection200Response**](../Model/SyncSkillCollection200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateSkill()` + +```php +updateSkill($organisation, $skill_id, $update_skill_request): \QuantClient\Model\UpdateSkill200Response +``` + +Update Skill + +Updates an existing skill. For imported skills, this updates * local overrides (name, tags, triggerCondition) but not the source content. * Use the sync endpoint to update source content. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISkillsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$skill_id = 'skill_id_example'; // string | The skill ID +$update_skill_request = new \QuantClient\Model\UpdateSkillRequest(); // \QuantClient\Model\UpdateSkillRequest + +try { + $result = $apiInstance->updateSkill($organisation, $skill_id, $update_skill_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISkillsApi->updateSkill: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **skill_id** | **string**| The skill ID | | +| **update_skill_request** | [**\QuantClient\Model\UpdateSkillRequest**](../Model/UpdateSkillRequest.md)| | | + +### Return type + +[**\QuantClient\Model\UpdateSkill200Response**](../Model/UpdateSkill200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/AISlackBotsApi.md b/docs/Api/AISlackBotsApi.md new file mode 100644 index 00000000..d21d1153 --- /dev/null +++ b/docs/Api/AISlackBotsApi.md @@ -0,0 +1,452 @@ +# QuantClient\AISlackBotsApi + +All URIs are relative to https://dashboard.quantcdn.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createSlackBot()**](AISlackBotsApi.md#createSlackBot) | **POST** /api/v3/organizations/{organisation}/ai/slack-bots | Create Slack Bot | +| [**deleteSlackBot()**](AISlackBotsApi.md#deleteSlackBot) | **DELETE** /api/v3/organizations/{organisation}/ai/slack-bots/{botId} | Delete Slack Bot | +| [**getSlackBot()**](AISlackBotsApi.md#getSlackBot) | **GET** /api/v3/organizations/{organisation}/ai/slack-bots/{botId} | Get Slack Bot | +| [**listSlackBots()**](AISlackBotsApi.md#listSlackBots) | **GET** /api/v3/organizations/{organisation}/ai/slack-bots | List Slack Bots | +| [**searchSlackWorkspaceChannels()**](AISlackBotsApi.md#searchSlackWorkspaceChannels) | **GET** /api/v3/organizations/{organisation}/ai/slack-bots/{botId}/workspace/channels | Search Slack Workspace Channels | +| [**searchSlackWorkspaceUsers()**](AISlackBotsApi.md#searchSlackWorkspaceUsers) | **GET** /api/v3/organizations/{organisation}/ai/slack-bots/{botId}/workspace/users | Search Slack Workspace Users | +| [**updateSlackBot()**](AISlackBotsApi.md#updateSlackBot) | **PUT** /api/v3/organizations/{organisation}/ai/slack-bots/{botId} | Update Slack Bot | + + +## `createSlackBot()` + +```php +createSlackBot($organisation, $create_slack_bot_request): \QuantClient\Model\CreateSlackBot201Response +``` + +Create Slack Bot + +Creates a new Slack bot with inline AI agent configuration. A backing agent is created automatically — callers do not need to manage agents separately. * * **Setup Types:** * - `quant`: Quant-managed Slack app — uses shared OAuth credentials * - `byo`: Bring Your Own — customer provides their own Slack app credentials + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISlackBotsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$create_slack_bot_request = new \QuantClient\Model\CreateSlackBotRequest(); // \QuantClient\Model\CreateSlackBotRequest + +try { + $result = $apiInstance->createSlackBot($organisation, $create_slack_bot_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISlackBotsApi->createSlackBot: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **create_slack_bot_request** | [**\QuantClient\Model\CreateSlackBotRequest**](../Model/CreateSlackBotRequest.md)| | | + +### Return type + +[**\QuantClient\Model\CreateSlackBot201Response**](../Model/CreateSlackBot201Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteSlackBot()` + +```php +deleteSlackBot($organisation, $bot_id): \QuantClient\Model\DeleteSlackBot200Response +``` + +Delete Slack Bot + +Permanently deletes a Slack bot, disconnects it from the workspace, and deletes its backing AI agent. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISlackBotsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$bot_id = 'bot_id_example'; // string | The Slack bot ID + +try { + $result = $apiInstance->deleteSlackBot($organisation, $bot_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISlackBotsApi->deleteSlackBot: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **bot_id** | **string**| The Slack bot ID | | + +### Return type + +[**\QuantClient\Model\DeleteSlackBot200Response**](../Model/DeleteSlackBot200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSlackBot()` + +```php +getSlackBot($organisation, $bot_id): \QuantClient\Model\GetSlackBot200Response +``` + +Get Slack Bot + +Retrieves details for a specific Slack bot including its configuration, connection status, and flattened agent configuration. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISlackBotsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$bot_id = 'bot_id_example'; // string | The Slack bot ID + +try { + $result = $apiInstance->getSlackBot($organisation, $bot_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISlackBotsApi->getSlackBot: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **bot_id** | **string**| The Slack bot ID | | + +### Return type + +[**\QuantClient\Model\GetSlackBot200Response**](../Model/GetSlackBot200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listSlackBots()` + +```php +listSlackBots($organisation): \QuantClient\Model\ListSlackBots200Response +``` + +List Slack Bots + +Lists all Slack bots configured for the organization. Each bot is backed by an AI agent and can be connected to a Slack workspace. Agent configuration fields are flattened onto each bot object. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISlackBotsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID + +try { + $result = $apiInstance->listSlackBots($organisation); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISlackBotsApi->listSlackBots: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | + +### Return type + +[**\QuantClient\Model\ListSlackBots200Response**](../Model/ListSlackBots200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `searchSlackWorkspaceChannels()` + +```php +searchSlackWorkspaceChannels($organisation, $bot_id, $q): \QuantClient\Model\SearchSlackWorkspaceChannels200Response +``` + +Search Slack Workspace Channels + +Searches channels in the Slack workspace connected to this bot. Requires the bot to be connected via OAuth. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISlackBotsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$bot_id = 'bot_id_example'; // string | The Slack bot ID +$q = 'q_example'; // string | Search query to filter channels by name + +try { + $result = $apiInstance->searchSlackWorkspaceChannels($organisation, $bot_id, $q); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISlackBotsApi->searchSlackWorkspaceChannels: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **bot_id** | **string**| The Slack bot ID | | +| **q** | **string**| Search query to filter channels by name | [optional] | + +### Return type + +[**\QuantClient\Model\SearchSlackWorkspaceChannels200Response**](../Model/SearchSlackWorkspaceChannels200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `searchSlackWorkspaceUsers()` + +```php +searchSlackWorkspaceUsers($organisation, $bot_id, $q): \QuantClient\Model\SearchSlackWorkspaceUsers200Response +``` + +Search Slack Workspace Users + +Searches users in the Slack workspace connected to this bot. Requires the bot to be connected via OAuth. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISlackBotsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$bot_id = 'bot_id_example'; // string | The Slack bot ID +$q = 'q_example'; // string | Search query to filter users by name + +try { + $result = $apiInstance->searchSlackWorkspaceUsers($organisation, $bot_id, $q); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISlackBotsApi->searchSlackWorkspaceUsers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **bot_id** | **string**| The Slack bot ID | | +| **q** | **string**| Search query to filter users by name | [optional] | + +### Return type + +[**\QuantClient\Model\SearchSlackWorkspaceUsers200Response**](../Model/SearchSlackWorkspaceUsers200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateSlackBot()` + +```php +updateSlackBot($organisation, $bot_id, $update_slack_bot_request): \QuantClient\Model\CreateSlackBot201Response +``` + +Update Slack Bot + +Updates a Slack bot's configuration and/or its backing agent. Only provided fields are updated. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AISlackBotsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | The organisation ID +$bot_id = 'bot_id_example'; // string | The Slack bot ID +$update_slack_bot_request = new \QuantClient\Model\UpdateSlackBotRequest(); // \QuantClient\Model\UpdateSlackBotRequest + +try { + $result = $apiInstance->updateSlackBot($organisation, $bot_id, $update_slack_bot_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AISlackBotsApi->updateSlackBot: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **bot_id** | **string**| The Slack bot ID | | +| **update_slack_bot_request** | [**\QuantClient\Model\UpdateSlackBotRequest**](../Model/UpdateSlackBotRequest.md)| | | + +### Return type + +[**\QuantClient\Model\CreateSlackBot201Response**](../Model/CreateSlackBot201Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/AIToolsApi.md b/docs/Api/AIToolsApi.md index a2bffdc0..018d1e2e 100644 --- a/docs/Api/AIToolsApi.md +++ b/docs/Api/AIToolsApi.md @@ -4,7 +4,7 @@ All URIs are relative to https://dashboard.quantcdn.io, except if the operation | Method | HTTP request | Description | | ------------- | ------------- | ------------- | -| [**getAIOrchestrationStatus()**](AIToolsApi.md#getAIOrchestrationStatus) | **GET** /api/v3/organizations/{organisation}/ai/tools/orchestrations/{orchestrationId} | Get Orchestration Status | +| [**getAIOrchestrationStatus()**](AIToolsApi.md#getAIOrchestrationStatus) | **GET** /api/v3/organizations/{organisation}/ai/tools/orchestrations/{orchestrationId} | Get Tool Orchestration Status (Async Tool Polling) | | [**getAIToolExecutionStatus()**](AIToolsApi.md#getAIToolExecutionStatus) | **GET** /api/v3/organizations/{organisation}/ai/tools/executions/{executionId} | Get async tool execution status and result | | [**listAIToolExecutions()**](AIToolsApi.md#listAIToolExecutions) | **GET** /api/v3/organizations/{organisation}/ai/tools/executions | List tool executions for monitoring and debugging | | [**listAIToolNames()**](AIToolsApi.md#listAIToolNames) | **GET** /api/v3/organizations/{organisation}/ai/tools/names | List tool names only (lightweight response) | @@ -17,9 +17,9 @@ All URIs are relative to https://dashboard.quantcdn.io, except if the operation getAIOrchestrationStatus($organisation, $orchestration_id): \QuantClient\Model\GetAIOrchestrationStatus200Response ``` -Get Orchestration Status +Get Tool Orchestration Status (Async Tool Polling) -Retrieves the status and synthesized result of a multi-tool orchestration. * * **Orchestration Pattern:** * When the AI requests multiple async tools simultaneously, an orchestration is created * to track all tool executions and synthesize their results into a single coherent response. * * **Flow:** * 1. AI requests multiple async tools (e.g., image generation + web search) * 2. Chat API creates orchestration and returns orchestrationId * 3. Tool Orchestrator Lambda polls all async tools * 4. When all tools complete, Orchestrator synthesizes results using AI * 5. Client polls this endpoint and receives final synthesized response * * **Status Values:** * - pending: Orchestration created, tools not yet started * - polling: Orchestrator is actively polling async tools * - synthesizing: All tools complete, AI is synthesizing response * - complete: Orchestration finished, synthesizedResponse available * - failed: Orchestration failed, error available * * **Polling Recommendations:** * - Poll every 2 seconds * - Maximum poll time: 10 minutes * - Orchestrator handles tool polling internally * * **Benefits over individual polling:** * - Single poll endpoint for multiple async tools * - AI synthesizes all results into coherent response * - Answers the original user question, not just tool summaries +Retrieves the status and synthesized result of a multi-tool async execution orchestration. * * **Note:** This endpoint is for async tool execution polling (`/tools/orchestrations`). * For durable batch processing orchestrations, see `GET /orchestrations` endpoints. * * **Orchestration Pattern:** * When the AI requests multiple async tools simultaneously, an orchestration is created * to track all tool executions and synthesize their results into a single coherent response. * * **Flow:** * 1. AI requests multiple async tools (e.g., image generation + web search) * 2. Chat API creates orchestration and returns orchestrationId * 3. Tool Orchestrator Lambda polls all async tools * 4. When all tools complete, Orchestrator synthesizes results using AI * 5. Client polls this endpoint and receives final synthesized response * * **Status Values:** * - pending: Orchestration created, tools not yet started * - polling: Orchestrator is actively polling async tools * - synthesizing: All tools complete, AI is synthesizing response * - complete: Orchestration finished, synthesizedResponse available * - failed: Orchestration failed, error available * * **Polling Recommendations:** * - Poll every 2 seconds * - Maximum poll time: 10 minutes * - Orchestrator handles tool polling internally * * **Benefits over individual polling:** * - Single poll endpoint for multiple async tools * - AI synthesizes all results into coherent response * - Answers the original user question, not just tool summaries ### Example diff --git a/docs/Api/AIMonitoringApi.md b/docs/Api/AIUsageApi.md similarity index 62% rename from docs/Api/AIMonitoringApi.md rename to docs/Api/AIUsageApi.md index 6c108a4a..ea58407e 100644 --- a/docs/Api/AIMonitoringApi.md +++ b/docs/Api/AIUsageApi.md @@ -1,19 +1,19 @@ -# QuantClient\AIMonitoringApi +# QuantClient\AIUsageApi All URIs are relative to https://dashboard.quantcdn.io, except if the operation defines another base path. | Method | HTTP request | Description | | ------------- | ------------- | ------------- | -| [**getAIUsageStats()**](AIMonitoringApi.md#getAIUsageStats) | **GET** /api/v3/organizations/{organisation}/ai/usage | Get AI usage statistics | +| [**getMyUsage()**](AIUsageApi.md#getMyUsage) | **GET** /api/v3/organizations/{organisation}/ai/usage/me | Get AI usage summary for the authenticated user | -## `getAIUsageStats()` +## `getMyUsage()` ```php -getAIUsageStats($organisation, $month): \QuantClient\Model\GetAIUsageStats200Response +getMyUsage($organisation): \QuantClient\Model\GetMyUsage200Response ``` -Get AI usage statistics +Get AI usage summary for the authenticated user ### Example @@ -26,20 +26,19 @@ require_once(__DIR__ . '/vendor/autoload.php'); $config = QuantClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -$apiInstance = new QuantClient\Api\AIMonitoringApi( +$apiInstance = new QuantClient\Api\AIUsageApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $organisation = 'organisation_example'; // string | The organisation ID -$month = 2025-10; // string | Month to retrieve statistics for (YYYY-MM format) try { - $result = $apiInstance->getAIUsageStats($organisation, $month); + $result = $apiInstance->getMyUsage($organisation); print_r($result); } catch (Exception $e) { - echo 'Exception when calling AIMonitoringApi->getAIUsageStats: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AIUsageApi->getMyUsage: ', $e->getMessage(), PHP_EOL; } ``` @@ -48,11 +47,10 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | | **organisation** | **string**| The organisation ID | | -| **month** | **string**| Month to retrieve statistics for (YYYY-MM format) | [optional] | ### Return type -[**\QuantClient\Model\GetAIUsageStats200Response**](../Model/GetAIUsageStats200Response.md) +[**\QuantClient\Model\GetMyUsage200Response**](../Model/GetMyUsage200Response.md) ### Authorization diff --git a/docs/Api/AIVectorDatabaseApi.md b/docs/Api/AIVectorDatabaseApi.md index 78a65818..88b68f02 100644 --- a/docs/Api/AIVectorDatabaseApi.md +++ b/docs/Api/AIVectorDatabaseApi.md @@ -6,8 +6,10 @@ All URIs are relative to https://dashboard.quantcdn.io, except if the operation | ------------- | ------------- | ------------- | | [**createVectorCollection()**](AIVectorDatabaseApi.md#createVectorCollection) | **POST** /api/v3/organizations/{organisation}/ai/vector-db/collections | Create Vector Database Collection | | [**deleteVectorCollection()**](AIVectorDatabaseApi.md#deleteVectorCollection) | **DELETE** /api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId} | Delete Collection | +| [**deleteVectorDocuments()**](AIVectorDatabaseApi.md#deleteVectorDocuments) | **DELETE** /api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId}/documents | Delete Documents from Collection | | [**getVectorCollection()**](AIVectorDatabaseApi.md#getVectorCollection) | **GET** /api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId} | Get Collection Details | | [**listVectorCollections()**](AIVectorDatabaseApi.md#listVectorCollections) | **GET** /api/v3/organizations/{organisation}/ai/vector-db/collections | List Vector Database Collections | +| [**listVectorDocuments()**](AIVectorDatabaseApi.md#listVectorDocuments) | **GET** /api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId}/documents | List Documents in Collection | | [**queryVectorCollection()**](AIVectorDatabaseApi.md#queryVectorCollection) | **POST** /api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId}/query | Semantic Search Query | | [**uploadVectorDocuments()**](AIVectorDatabaseApi.md#uploadVectorDocuments) | **POST** /api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId}/documents | Upload Documents to Collection | @@ -77,7 +79,7 @@ try { ## `deleteVectorCollection()` ```php -deleteVectorCollection($organisation, $collection_id): \QuantClient\Model\DeleteVectorCollection200Response +deleteVectorCollection($organisation, $collection_id): \QuantClient\Model\DeleteSkillCollection200Response ``` Delete Collection @@ -121,7 +123,7 @@ try { ### Return type -[**\QuantClient\Model\DeleteVectorCollection200Response**](../Model/DeleteVectorCollection200Response.md) +[**\QuantClient\Model\DeleteSkillCollection200Response**](../Model/DeleteSkillCollection200Response.md) ### Authorization @@ -136,6 +138,70 @@ try { [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `deleteVectorDocuments()` + +```php +deleteVectorDocuments($organisation, $collection_id, $delete_vector_documents_request): \QuantClient\Model\DeleteVectorDocuments200Response +``` + +Delete Documents from Collection + +Delete documents from a collection. Supports three deletion modes: * * 1. **Purge All** - Set `purgeAll: true` to delete ALL documents in the collection * * 2. **By Document IDs** - Provide `documentIds` array with specific document UUIDs * * 3. **By Metadata** - Provide `metadata` object with `field` and `values` to delete documents where the metadata field matches any of the values * * **Drupal Integration:** * When using with Drupal AI Search, use metadata deletion with: * - `field: 'drupal_entity_id'` to delete all chunks for specific entities * - `field: 'drupal_long_id'` to delete specific chunks + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIVectorDatabaseApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string | Organisation machine name +$collection_id = 'collection_id_example'; // string | Collection UUID +$delete_vector_documents_request = new \QuantClient\Model\DeleteVectorDocumentsRequest(); // \QuantClient\Model\DeleteVectorDocumentsRequest + +try { + $result = $apiInstance->deleteVectorDocuments($organisation, $collection_id, $delete_vector_documents_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AIVectorDatabaseApi->deleteVectorDocuments: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| Organisation machine name | | +| **collection_id** | **string**| Collection UUID | | +| **delete_vector_documents_request** | [**\QuantClient\Model\DeleteVectorDocumentsRequest**](../Model/DeleteVectorDocumentsRequest.md)| | | + +### Return type + +[**\QuantClient\Model\DeleteVectorDocuments200Response**](../Model/DeleteVectorDocuments200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `getVectorCollection()` ```php @@ -258,6 +324,73 @@ try { [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `listVectorDocuments()` + +```php +listVectorDocuments($organisation, $collection_id, $key, $limit, $offset) +``` + +List Documents in Collection + +Lists documents in a collection with pagination. Supports filtering by document key. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\AIVectorDatabaseApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$collection_id = 'collection_id_example'; // string +$key = 'key_example'; // string | Filter by document key +$limit = 50; // int +$offset = 0; // int + +try { + $apiInstance->listVectorDocuments($organisation, $collection_id, $key, $limit, $offset); +} catch (Exception $e) { + echo 'Exception when calling AIVectorDatabaseApi->listVectorDocuments: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **collection_id** | **string**| | | +| **key** | **string**| Filter by document key | [optional] | +| **limit** | **int**| | [optional] [default to 50] | +| **offset** | **int**| | [optional] [default to 0] | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `queryVectorCollection()` ```php diff --git a/docs/Api/CDNMetricsApi.md b/docs/Api/CDNMetricsApi.md new file mode 100644 index 00000000..59a0b0c4 --- /dev/null +++ b/docs/Api/CDNMetricsApi.md @@ -0,0 +1,214 @@ +# QuantClient\CDNMetricsApi + +All URIs are relative to https://dashboard.quantcdn.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getDailyMetrics()**](CDNMetricsApi.md#getDailyMetrics) | **GET** /v2/organizations/{organization}/projects/{project}/metrics/daily | Get daily metrics | +| [**getHourlyMetrics()**](CDNMetricsApi.md#getHourlyMetrics) | **GET** /v2/organizations/{organization}/projects/{project}/metrics/hourly | Get hourly metrics | +| [**getMonthlyMetrics()**](CDNMetricsApi.md#getMonthlyMetrics) | **GET** /v2/organizations/{organization}/projects/{project}/metrics/monthly | Get monthly metrics | + + +## `getDailyMetrics()` + +```php +getDailyMetrics($organization, $project, $domain, $metrics, $timestamp_format): \QuantClient\Model\V2MetricsResponse +``` + +Get daily metrics + +Returns the last 30 days of daily metrics data + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\CDNMetricsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organization = 'organization_example'; // string | Organization identifier +$project = 'project_example'; // string | Project identifier +$domain = 'domain_example'; // string | Filter by domain ID or domain name +$metrics = array('metrics_example'); // string[] | Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. +$timestamp_format = 'iso8601'; // string | Timestamp format in response + +try { + $result = $apiInstance->getDailyMetrics($organization, $project, $domain, $metrics, $timestamp_format); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CDNMetricsApi->getDailyMetrics: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organization** | **string**| Organization identifier | | +| **project** | **string**| Project identifier | | +| **domain** | **string**| Filter by domain ID or domain name | [optional] | +| **metrics** | [**string[]**](../Model/string.md)| Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. | [optional] | +| **timestamp_format** | **string**| Timestamp format in response | [optional] [default to 'iso8601'] | + +### Return type + +[**\QuantClient\Model\V2MetricsResponse**](../Model/V2MetricsResponse.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getHourlyMetrics()` + +```php +getHourlyMetrics($organization, $project, $domain, $metrics, $timestamp_format): \QuantClient\Model\V2MetricsResponse +``` + +Get hourly metrics + +Returns the last hour of minute-by-minute metrics data + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\CDNMetricsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organization = 'organization_example'; // string | Organization identifier +$project = 'project_example'; // string | Project identifier +$domain = 'domain_example'; // string | Filter by domain ID or domain name +$metrics = array('metrics_example'); // string[] | Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. +$timestamp_format = 'iso8601'; // string | Timestamp format in response + +try { + $result = $apiInstance->getHourlyMetrics($organization, $project, $domain, $metrics, $timestamp_format); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CDNMetricsApi->getHourlyMetrics: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organization** | **string**| Organization identifier | | +| **project** | **string**| Project identifier | | +| **domain** | **string**| Filter by domain ID or domain name | [optional] | +| **metrics** | [**string[]**](../Model/string.md)| Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. | [optional] | +| **timestamp_format** | **string**| Timestamp format in response | [optional] [default to 'iso8601'] | + +### Return type + +[**\QuantClient\Model\V2MetricsResponse**](../Model/V2MetricsResponse.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getMonthlyMetrics()` + +```php +getMonthlyMetrics($organization, $project, $domain, $metrics, $timestamp_format): \QuantClient\Model\V2MetricsResponse +``` + +Get monthly metrics + +Returns the last 12 months of monthly metrics data + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\CDNMetricsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organization = 'organization_example'; // string | Organization identifier +$project = 'project_example'; // string | Project identifier +$domain = 'domain_example'; // string | Filter by domain ID or domain name +$metrics = array('metrics_example'); // string[] | Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. +$timestamp_format = 'iso8601'; // string | Timestamp format in response + +try { + $result = $apiInstance->getMonthlyMetrics($organization, $project, $domain, $metrics, $timestamp_format); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CDNMetricsApi->getMonthlyMetrics: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organization** | **string**| Organization identifier | | +| **project** | **string**| Project identifier | | +| **domain** | **string**| Filter by domain ID or domain name | [optional] | +| **metrics** | [**string[]**](../Model/string.md)| Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. | [optional] | +| **timestamp_format** | **string**| Timestamp format in response | [optional] [default to 'iso8601'] | + +### Return type + +[**\QuantClient\Model\V2MetricsResponse**](../Model/V2MetricsResponse.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/KVApi.md b/docs/Api/KVApi.md index 136f6718..0f2e81df 100644 --- a/docs/Api/KVApi.md +++ b/docs/Api/KVApi.md @@ -11,8 +11,10 @@ All URIs are relative to https://dashboard.quantcdn.io, except if the operation | [**kVItemsList()**](KVApi.md#kVItemsList) | **GET** /api/v2/organizations/{organization}/projects/{project}/kv/{store_id}/items | List items in a kv store | | [**kVItemsShow()**](KVApi.md#kVItemsShow) | **GET** /api/v2/organizations/{organization}/projects/{project}/kv/{store_id}/items/{key} | Get an item from a kv store | | [**kVItemsUpdate()**](KVApi.md#kVItemsUpdate) | **PUT** /api/v2/organizations/{organization}/projects/{project}/kv/{store_id}/items/{key} | Update an item in a kv store | +| [**kVLinkToProject()**](KVApi.md#kVLinkToProject) | **POST** /api/v2/organizations/{organization}/projects/{project}/kv/{store_id}/link | Link a KV store to another project | | [**kVList()**](KVApi.md#kVList) | **GET** /api/v2/organizations/{organization}/projects/{project}/kv | List key-value stores | | [**kVShow()**](KVApi.md#kVShow) | **GET** /api/v2/organizations/{organization}/projects/{project}/kv/{store_id} | Get a kv store | +| [**kVUnlinkFromProject()**](KVApi.md#kVUnlinkFromProject) | **DELETE** /api/v2/organizations/{organization}/projects/{project}/kv/{store_id}/link | Unlink a KV store from this project | ## `kVCreate()` @@ -468,6 +470,72 @@ try { [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `kVLinkToProject()` + +```php +kVLinkToProject($organization, $project, $store_id, $kv_link_to_project_request): \QuantClient\Model\KVLinkToProject200Response +``` + +Link a KV store to another project + +Share a KV store from the source project with a target project. The store will be accessible in the target project. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\KVApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organization = test-org; // string | Organization identifier +$project = test-project; // string | Source project identifier +$store_id = store-123; // string | KV store identifier +$kv_link_to_project_request = new \QuantClient\Model\KVLinkToProjectRequest(); // \QuantClient\Model\KVLinkToProjectRequest + +try { + $result = $apiInstance->kVLinkToProject($organization, $project, $store_id, $kv_link_to_project_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling KVApi->kVLinkToProject: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organization** | **string**| Organization identifier | | +| **project** | **string**| Source project identifier | | +| **store_id** | **string**| KV store identifier | | +| **kv_link_to_project_request** | [**\QuantClient\Model\KVLinkToProjectRequest**](../Model/KVLinkToProjectRequest.md)| | | + +### Return type + +[**\QuantClient\Model\KVLinkToProject200Response**](../Model/KVLinkToProject200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `kVList()` ```php @@ -589,3 +657,67 @@ try { [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) + +## `kVUnlinkFromProject()` + +```php +kVUnlinkFromProject($organization, $project, $store_id): \QuantClient\Model\KVLinkToProject200Response +``` + +Unlink a KV store from this project + +Remove access to a linked KV store from this project. The store must be linked (not owned by this project). + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\KVApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organization = test-org; // string | Organization identifier +$project = test-project; // string | Project identifier +$store_id = store-123; // string | KV store identifier + +try { + $result = $apiInstance->kVUnlinkFromProject($organization, $project, $store_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling KVApi->kVUnlinkFromProject: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organization** | **string**| Organization identifier | | +| **project** | **string**| Project identifier | | +| **store_id** | **string**| KV store identifier | | + +### Return type + +[**\QuantClient\Model\KVLinkToProject200Response**](../Model/KVLinkToProject200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/OpenAICompatibilityApi.md b/docs/Api/OpenAICompatibilityApi.md new file mode 100644 index 00000000..74d46058 --- /dev/null +++ b/docs/Api/OpenAICompatibilityApi.md @@ -0,0 +1,248 @@ +# QuantClient\OpenAICompatibilityApi + +All URIs are relative to https://dashboard.quantcdn.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**oaiChatCompletions()**](OpenAICompatibilityApi.md#oaiChatCompletions) | **POST** /oai/v1/chat/completions | Create a chat completion (OpenAI-compatible) | +| [**oaiEmbeddings()**](OpenAICompatibilityApi.md#oaiEmbeddings) | **POST** /oai/v1/embeddings | Create embeddings (OpenAI-compatible) | +| [**oaiGetModel()**](OpenAICompatibilityApi.md#oaiGetModel) | **GET** /oai/v1/models/{model} | Retrieve a model (OpenAI-compatible) | +| [**oaiListModels()**](OpenAICompatibilityApi.md#oaiListModels) | **GET** /oai/v1/models | List available models (OpenAI-compatible) | + + +## `oaiChatCompletions()` + +```php +oaiChatCompletions($oai_chat_completions_request): \QuantClient\Model\OaiChatCompletions200Response +``` + +Create a chat completion (OpenAI-compatible) + +Drop-in replacement for OpenAI's POST /v1/chat/completions. Point any OpenAI SDK at base_url=https:///oai/v1 and use a Quant API token (qc_...) as the api_key. Set `stream: true` to receive Server-Sent Events (chat.completion.chunk objects terminated by `data: [DONE]`); otherwise a single chat.completion object is returned. Supports tool/function calling and the standard tool_choice modes. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\OpenAICompatibilityApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$oai_chat_completions_request = new \QuantClient\Model\OaiChatCompletionsRequest(); // \QuantClient\Model\OaiChatCompletionsRequest + +try { + $result = $apiInstance->oaiChatCompletions($oai_chat_completions_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OpenAICompatibilityApi->oaiChatCompletions: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **oai_chat_completions_request** | [**\QuantClient\Model\OaiChatCompletionsRequest**](../Model/OaiChatCompletionsRequest.md)| | | + +### Return type + +[**\QuantClient\Model\OaiChatCompletions200Response**](../Model/OaiChatCompletions200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `oaiEmbeddings()` + +```php +oaiEmbeddings($oai_embeddings_request): \QuantClient\Model\OaiEmbeddings200Response +``` + +Create embeddings (OpenAI-compatible) + +Drop-in replacement for OpenAI's POST /v1/embeddings. Accepts a single string or an array of strings in `input` and returns a list of embedding objects. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\OpenAICompatibilityApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$oai_embeddings_request = new \QuantClient\Model\OaiEmbeddingsRequest(); // \QuantClient\Model\OaiEmbeddingsRequest + +try { + $result = $apiInstance->oaiEmbeddings($oai_embeddings_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OpenAICompatibilityApi->oaiEmbeddings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **oai_embeddings_request** | [**\QuantClient\Model\OaiEmbeddingsRequest**](../Model/OaiEmbeddingsRequest.md)| | | + +### Return type + +[**\QuantClient\Model\OaiEmbeddings200Response**](../Model/OaiEmbeddings200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `oaiGetModel()` + +```php +oaiGetModel($model): \QuantClient\Model\OaiGetModel200Response +``` + +Retrieve a model (OpenAI-compatible) + +Drop-in replacement for OpenAI's GET /v1/models/{model}. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\OpenAICompatibilityApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$model = amazon.nova-micro-v1:0; // string + +try { + $result = $apiInstance->oaiGetModel($model); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OpenAICompatibilityApi->oaiGetModel: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **model** | **string**| | | + +### Return type + +[**\QuantClient\Model\OaiGetModel200Response**](../Model/OaiGetModel200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `oaiListModels()` + +```php +oaiListModels(): \QuantClient\Model\OaiListModels200Response +``` + +List available models (OpenAI-compatible) + +Drop-in replacement for OpenAI's GET /v1/models. Returns the model ids available to the organisation; pass one of these ids as `model` in chat/embeddings requests. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\OpenAICompatibilityApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->oaiListModels(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OpenAICompatibilityApi->oaiListModels: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\QuantClient\Model\OaiListModels200Response**](../Model/OaiListModels200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/OrchestrationApi.md b/docs/Api/OrchestrationApi.md deleted file mode 100644 index d0e36f40..00000000 --- a/docs/Api/OrchestrationApi.md +++ /dev/null @@ -1,70 +0,0 @@ -# QuantClient\OrchestrationApi - -All URIs are relative to https://dashboard.quantcdn.io, except if the operation defines another base path. - -| Method | HTTP request | Description | -| ------------- | ------------- | ------------- | -| [**getAIOrchestrationStatus()**](OrchestrationApi.md#getAIOrchestrationStatus) | **GET** /api/v3/organizations/{organisation}/ai/tools/orchestrations/{orchestrationId} | Get Orchestration Status | - - -## `getAIOrchestrationStatus()` - -```php -getAIOrchestrationStatus($organisation, $orchestration_id): \QuantClient\Model\GetAIOrchestrationStatus200Response -``` - -Get Orchestration Status - -Retrieves the status and synthesized result of a multi-tool orchestration. * * **Orchestration Pattern:** * When the AI requests multiple async tools simultaneously, an orchestration is created * to track all tool executions and synthesize their results into a single coherent response. * * **Flow:** * 1. AI requests multiple async tools (e.g., image generation + web search) * 2. Chat API creates orchestration and returns orchestrationId * 3. Tool Orchestrator Lambda polls all async tools * 4. When all tools complete, Orchestrator synthesizes results using AI * 5. Client polls this endpoint and receives final synthesized response * * **Status Values:** * - pending: Orchestration created, tools not yet started * - polling: Orchestrator is actively polling async tools * - synthesizing: All tools complete, AI is synthesizing response * - complete: Orchestration finished, synthesizedResponse available * - failed: Orchestration failed, error available * * **Polling Recommendations:** * - Poll every 2 seconds * - Maximum poll time: 10 minutes * - Orchestrator handles tool polling internally * * **Benefits over individual polling:** * - Single poll endpoint for multiple async tools * - AI synthesizes all results into coherent response * - Answers the original user question, not just tool summaries - -### Example - -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - - -$apiInstance = new QuantClient\Api\OrchestrationApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$organisation = 'organisation_example'; // string | The organisation ID -$orchestration_id = orch_abc123def456789012345678901234; // string | Orchestration identifier for aggregated async tool executions - -try { - $result = $apiInstance->getAIOrchestrationStatus($organisation, $orchestration_id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling OrchestrationApi->getAIOrchestrationStatus: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **organisation** | **string**| The organisation ID | | -| **orchestration_id** | **string**| Orchestration identifier for aggregated async tool executions | | - -### Return type - -[**\QuantClient\Model\GetAIOrchestrationStatus200Response**](../Model/GetAIOrchestrationStatus200Response.md) - -### Authorization - -[BearerAuth](../../README.md#BearerAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) diff --git a/docs/Api/RestoreManagementApi.md b/docs/Api/RestoreManagementApi.md new file mode 100644 index 00000000..7a0af89c --- /dev/null +++ b/docs/Api/RestoreManagementApi.md @@ -0,0 +1,212 @@ +# QuantClient\RestoreManagementApi + +All URIs are relative to https://dashboard.quantcdn.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getRestoreStatus()**](RestoreManagementApi.md#getRestoreStatus) | **GET** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/restores/{restoreId} | Get the status of a restore operation | +| [**restoreDatabase()**](RestoreManagementApi.md#restoreDatabase) | **POST** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/backups/{backupId}/restore-database | Restore a database backup to a target environment | +| [**restoreFilesystem()**](RestoreManagementApi.md#restoreFilesystem) | **POST** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/backups/{backupId}/restore-filesystem | Restore a filesystem backup to a target environment | + + +## `getRestoreStatus()` + +```php +getRestoreStatus($organisation, $application, $environment, $restore_id): \QuantClient\Model\GetRestoreStatus200Response +``` + +Get the status of a restore operation + +Returns the current status and metadata for a restore operation. Poll this endpoint to track progress. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\RestoreManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = test-org; // string | The organisation ID +$application = test-app; // string | The application ID +$environment = staging; // string | The environment ID +$restore_id = restore-abc123; // string | The restore operation ID + +try { + $result = $apiInstance->getRestoreStatus($organisation, $application, $environment, $restore_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RestoreManagementApi->getRestoreStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **application** | **string**| The application ID | | +| **environment** | **string**| The environment ID | | +| **restore_id** | **string**| The restore operation ID | | + +### Return type + +[**\QuantClient\Model\GetRestoreStatus200Response**](../Model/GetRestoreStatus200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `restoreDatabase()` + +```php +restoreDatabase($organisation, $application, $environment, $backup_id, $restore_database_request): \QuantClient\Model\RestoreDatabase202Response +``` + +Restore a database backup to a target environment + +Initiates an async restore of a database backup into the specified target environment. The backup may originate from a different environment of the same application (cross-env restore). Returns 202 with a restoreId for status polling. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\RestoreManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = test-org; // string | The organisation ID +$application = test-app; // string | The application ID +$environment = staging; // string | The TARGET environment ID to restore INTO +$backup_id = quant-gov-dashboard-staging-2025-09-19T21-50-27-145Z; // string | The backup ID to restore from +$restore_database_request = new \QuantClient\Model\RestoreDatabaseRequest(); // \QuantClient\Model\RestoreDatabaseRequest + +try { + $result = $apiInstance->restoreDatabase($organisation, $application, $environment, $backup_id, $restore_database_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RestoreManagementApi->restoreDatabase: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **application** | **string**| The application ID | | +| **environment** | **string**| The TARGET environment ID to restore INTO | | +| **backup_id** | **string**| The backup ID to restore from | | +| **restore_database_request** | [**\QuantClient\Model\RestoreDatabaseRequest**](../Model/RestoreDatabaseRequest.md)| | | + +### Return type + +[**\QuantClient\Model\RestoreDatabase202Response**](../Model/RestoreDatabase202Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `restoreFilesystem()` + +```php +restoreFilesystem($organisation, $application, $environment, $backup_id, $restore_filesystem_request): \QuantClient\Model\RestoreFilesystem202Response +``` + +Restore a filesystem backup to a target environment + +Initiates an async restore of a filesystem backup into the specified target environment. The backup may originate from a different environment of the same application (cross-env restore). Returns 202 with a restoreId for status polling. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\RestoreManagementApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = test-org; // string | The organisation ID +$application = test-app; // string | The application ID +$environment = staging; // string | The TARGET environment ID to restore INTO +$backup_id = quant-gov-dashboard-staging-2025-09-19T21-50-27-145Z; // string | The backup ID to restore from +$restore_filesystem_request = new \QuantClient\Model\RestoreFilesystemRequest(); // \QuantClient\Model\RestoreFilesystemRequest + +try { + $result = $apiInstance->restoreFilesystem($organisation, $application, $environment, $backup_id, $restore_filesystem_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RestoreManagementApi->restoreFilesystem: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| The organisation ID | | +| **application** | **string**| The application ID | | +| **environment** | **string**| The TARGET environment ID to restore INTO | | +| **backup_id** | **string**| The backup ID to restore from | | +| **restore_filesystem_request** | [**\QuantClient\Model\RestoreFilesystemRequest**](../Model/RestoreFilesystemRequest.md)| | | + +### Return type + +[**\QuantClient\Model\RestoreFilesystem202Response**](../Model/RestoreFilesystem202Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ScalingPolicyApi.md b/docs/Api/ScalingPolicyApi.md index 4542b7c5..d534b6a4 100644 --- a/docs/Api/ScalingPolicyApi.md +++ b/docs/Api/ScalingPolicyApi.md @@ -4,18 +4,20 @@ All URIs are relative to https://dashboard.quantcdn.io, except if the operation | Method | HTTP request | Description | | ------------- | ------------- | ------------- | -| [**deleteScalingPolicy()**](ScalingPolicyApi.md#deleteScalingPolicy) | **DELETE** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies/{policyName} | Delete the scaling policy for an environment | -| [**getScalingPolicies()**](ScalingPolicyApi.md#getScalingPolicies) | **GET** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies | Get the scaling policies for an environment | -| [**updateScalingPolicy()**](ScalingPolicyApi.md#updateScalingPolicy) | **PUT** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies | Update the scaling policy for an environment | +| [**deleteScalingPolicy()**](ScalingPolicyApi.md#deleteScalingPolicy) | **DELETE** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies | Delete Scaling Policy | +| [**listScalingPolicies()**](ScalingPolicyApi.md#listScalingPolicies) | **GET** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies | List Scaling Policies | +| [**upsertScalingPolicy()**](ScalingPolicyApi.md#upsertScalingPolicy) | **PUT** /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies | Upsert Scaling Policy | ## `deleteScalingPolicy()` ```php -deleteScalingPolicy($organisation, $application, $environment, $policy_name) +deleteScalingPolicy($organisation, $application, $environment, $metric, $policy_name) ``` -Delete the scaling policy for an environment +Delete Scaling Policy + +Deletes a specific scaling policy for the environment. Specify the metric type or policy name to delete a single policy. If neither is provided, all policies will be deleted. ### Example @@ -34,13 +36,14 @@ $apiInstance = new QuantClient\Api\ScalingPolicyApi( new GuzzleHttp\Client(), $config ); -$organisation = test-org; // string | The organisation ID -$application = test-app; // string | The application ID -$environment = test-env; // string | The environment ID -$policy_name = 'policy_name_example'; // string | The policy name +$organisation = 'organisation_example'; // string +$application = 'application_example'; // string +$environment = 'environment_example'; // string +$metric = 'metric_example'; // string | Optional. Delete by metric type. +$policy_name = 'policy_name_example'; // string | Optional. Delete by exact policy name. try { - $apiInstance->deleteScalingPolicy($organisation, $application, $environment, $policy_name); + $apiInstance->deleteScalingPolicy($organisation, $application, $environment, $metric, $policy_name); } catch (Exception $e) { echo 'Exception when calling ScalingPolicyApi->deleteScalingPolicy: ', $e->getMessage(), PHP_EOL; } @@ -50,10 +53,11 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | -| **organisation** | **string**| The organisation ID | | -| **application** | **string**| The application ID | | -| **environment** | **string**| The environment ID | | -| **policy_name** | **string**| The policy name | | +| **organisation** | **string**| | | +| **application** | **string**| | | +| **environment** | **string**| | | +| **metric** | **string**| Optional. Delete by metric type. | [optional] | +| **policy_name** | **string**| Optional. Delete by exact policy name. | [optional] | ### Return type @@ -72,13 +76,15 @@ void (empty response body) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getScalingPolicies()` +## `listScalingPolicies()` ```php -getScalingPolicies($organisation, $application, $environment) +listScalingPolicies($organisation, $application, $environment, $metric, $policy_name): \QuantClient\Model\ScalingPolicyListResponse ``` -Get the scaling policies for an environment +List Scaling Policies + +Retrieves all active target tracking scaling policies for the environment. Returns an array of policies, each with its metric, target value, cooldowns, and resource label (if applicable). ### Example @@ -97,14 +103,17 @@ $apiInstance = new QuantClient\Api\ScalingPolicyApi( new GuzzleHttp\Client(), $config ); -$organisation = test-org; // string | The organisation ID -$application = test-app; // string | The application ID -$environment = test-env; // string | The environment ID +$organisation = 'organisation_example'; // string +$application = 'application_example'; // string +$environment = 'environment_example'; // string +$metric = 'metric_example'; // string | Optional. Filter policies by metric type. +$policy_name = 'policy_name_example'; // string | Optional. Filter policies by exact policy name. try { - $apiInstance->getScalingPolicies($organisation, $application, $environment); + $result = $apiInstance->listScalingPolicies($organisation, $application, $environment, $metric, $policy_name); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling ScalingPolicyApi->getScalingPolicies: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ScalingPolicyApi->listScalingPolicies: ', $e->getMessage(), PHP_EOL; } ``` @@ -112,13 +121,15 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | -| **organisation** | **string**| The organisation ID | | -| **application** | **string**| The application ID | | -| **environment** | **string**| The environment ID | | +| **organisation** | **string**| | | +| **application** | **string**| | | +| **environment** | **string**| | | +| **metric** | **string**| Optional. Filter policies by metric type. | [optional] | +| **policy_name** | **string**| Optional. Filter policies by exact policy name. | [optional] | ### Return type -void (empty response body) +[**\QuantClient\Model\ScalingPolicyListResponse**](../Model/ScalingPolicyListResponse.md) ### Authorization @@ -127,19 +138,21 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: Not defined +- **Accept**: `application/json` [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `updateScalingPolicy()` +## `upsertScalingPolicy()` ```php -updateScalingPolicy($organisation, $application, $environment, $scaling_policy) +upsertScalingPolicy($organisation, $application, $environment, $set_scaling_policy_request, $policy_name): \QuantClient\Model\GetScalingPolicyResponse ``` -Update the scaling policy for an environment +Upsert Scaling Policy + +Creates or updates a target tracking scaling policy for the environment. Specify the metric type and target value. If a policy with the same metric or name exists, it will be updated. Optionally, provide a custom policy name via query. ### Example @@ -158,15 +171,17 @@ $apiInstance = new QuantClient\Api\ScalingPolicyApi( new GuzzleHttp\Client(), $config ); -$organisation = test-org; // string | The organisation ID -$application = test-app; // string | The application ID -$environment = test-env; // string | The environment ID -$scaling_policy = new \QuantClient\Model\ScalingPolicy(); // \QuantClient\Model\ScalingPolicy +$organisation = 'organisation_example'; // string +$application = 'application_example'; // string +$environment = 'environment_example'; // string +$set_scaling_policy_request = new \QuantClient\Model\SetScalingPolicyRequest(); // \QuantClient\Model\SetScalingPolicyRequest +$policy_name = 'policy_name_example'; // string | Optional. Specify a custom policy name to upsert. try { - $apiInstance->updateScalingPolicy($organisation, $application, $environment, $scaling_policy); + $result = $apiInstance->upsertScalingPolicy($organisation, $application, $environment, $set_scaling_policy_request, $policy_name); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling ScalingPolicyApi->updateScalingPolicy: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ScalingPolicyApi->upsertScalingPolicy: ', $e->getMessage(), PHP_EOL; } ``` @@ -174,14 +189,15 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | -| **organisation** | **string**| The organisation ID | | -| **application** | **string**| The application ID | | -| **environment** | **string**| The environment ID | | -| **scaling_policy** | [**\QuantClient\Model\ScalingPolicy**](../Model/ScalingPolicy.md)| | | +| **organisation** | **string**| | | +| **application** | **string**| | | +| **environment** | **string**| | | +| **set_scaling_policy_request** | [**\QuantClient\Model\SetScalingPolicyRequest**](../Model/SetScalingPolicyRequest.md)| | | +| **policy_name** | **string**| Optional. Specify a custom policy name to upsert. | [optional] | ### Return type -void (empty response body) +[**\QuantClient\Model\GetScalingPolicyResponse**](../Model/GetScalingPolicyResponse.md) ### Authorization @@ -190,7 +206,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: `application/json` -- **Accept**: Not defined +- **Accept**: `application/json` [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to Model list]](../../README.md#models) diff --git a/docs/Api/SubscriptionApi.md b/docs/Api/SubscriptionApi.md new file mode 100644 index 00000000..3089db57 --- /dev/null +++ b/docs/Api/SubscriptionApi.md @@ -0,0 +1,69 @@ +# QuantClient\SubscriptionApi + +All URIs are relative to https://dashboard.quantcdn.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getSubscriptionCloudUsage()**](SubscriptionApi.md#getSubscriptionCloudUsage) | **GET** /api/v3/organizations/{organisation}/subscription/cloud-usage | Cloud-app cost breakdown for the subscription page | + + +## `getSubscriptionCloudUsage()` + +```php +getSubscriptionCloudUsage($organisation, $month) +``` + +Cloud-app cost breakdown for the subscription page + +Per-project compute/database/storage cost breakdown with spot discount, for the requested month and the month before it. Mirrors the subscription page's Cloud Apps card. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\SubscriptionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organisation = 'organisation_example'; // string +$month = 'month_example'; // string | YYYY-MM, defaults to current month + +try { + $apiInstance->getSubscriptionCloudUsage($organisation, $month); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionApi->getSubscriptionCloudUsage: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organisation** | **string**| | | +| **month** | **string**| YYYY-MM, defaults to current month | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/TokensApi.md b/docs/Api/TokensApi.md new file mode 100644 index 00000000..d55333b1 --- /dev/null +++ b/docs/Api/TokensApi.md @@ -0,0 +1,188 @@ +# QuantClient\TokensApi + +All URIs are relative to https://dashboard.quantcdn.io, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**tokensCreate()**](TokensApi.md#tokensCreate) | **POST** /api/v2/organizations/{organization}/tokens | Create a new API token scoped to this organization | +| [**tokensDelete()**](TokensApi.md#tokensDelete) | **DELETE** /api/v2/organizations/{organization}/tokens/{token_id} | Revoke an API token | +| [**tokensList()**](TokensApi.md#tokensList) | **GET** /api/v2/organizations/{organization}/tokens | List API tokens scoped to this organization | + + +## `tokensCreate()` + +```php +tokensCreate($organization, $tokens_create_request): \QuantClient\Model\TokensCreate201Response +``` + +Create a new API token scoped to this organization + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\TokensApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organization = test-org; // string | Organization identifier +$tokens_create_request = new \QuantClient\Model\TokensCreateRequest(); // \QuantClient\Model\TokensCreateRequest + +try { + $result = $apiInstance->tokensCreate($organization, $tokens_create_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TokensApi->tokensCreate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organization** | **string**| Organization identifier | | +| **tokens_create_request** | [**\QuantClient\Model\TokensCreateRequest**](../Model/TokensCreateRequest.md)| | | + +### Return type + +[**\QuantClient\Model\TokensCreate201Response**](../Model/TokensCreate201Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `tokensDelete()` + +```php +tokensDelete($organization, $token_id): \QuantClient\Model\TokensDelete200Response +``` + +Revoke an API token + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\TokensApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organization = test-org; // string | Organization identifier +$token_id = 42; // int | Token ID to revoke + +try { + $result = $apiInstance->tokensDelete($organization, $token_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TokensApi->tokensDelete: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organization** | **string**| Organization identifier | | +| **token_id** | **int**| Token ID to revoke | | + +### Return type + +[**\QuantClient\Model\TokensDelete200Response**](../Model/TokensDelete200Response.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `tokensList()` + +```php +tokensList($organization): \QuantClient\Model\TokensList200ResponseInner[] +``` + +List API tokens scoped to this organization + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new QuantClient\Api\TokensApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organization = test-org; // string | Organization identifier + +try { + $result = $apiInstance->tokensList($organization); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TokensApi->tokensList: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **organization** | **string**| Organization identifier | | + +### Return type + +[**\QuantClient\Model\TokensList200ResponseInner[]**](../Model/TokensList200ResponseInner.md) + +### Authorization + +[BearerAuth](../../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Model/AiSearchChatRequest.md b/docs/Model/AiSearchChatRequest.md new file mode 100644 index 00000000..9f154017 --- /dev/null +++ b/docs/Model/AiSearchChatRequest.md @@ -0,0 +1,12 @@ +# # AiSearchChatRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **string** | | +**session_id** | **string** | | [optional] +**context_url** | **string** | | [optional] +**max_context_chunks** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetAIUsageStats200ResponseByModelValue.md b/docs/Model/AiSearchDeletePagesRequest.md similarity index 57% rename from docs/Model/GetAIUsageStats200ResponseByModelValue.md rename to docs/Model/AiSearchDeletePagesRequest.md index d7937583..7f502ea6 100644 --- a/docs/Model/GetAIUsageStats200ResponseByModelValue.md +++ b/docs/Model/AiSearchDeletePagesRequest.md @@ -1,10 +1,10 @@ -# # GetAIUsageStats200ResponseByModelValue +# # AiSearchDeletePagesRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**requests** | **int** | Number of requests for this model | [optional] -**tokens** | **int** | Total tokens for this model | [optional] +**urls** | **string[]** | | [optional] +**patterns** | **string[]** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AiSearchEnableRequest.md b/docs/Model/AiSearchEnableRequest.md new file mode 100644 index 00000000..89aeabfe --- /dev/null +++ b/docs/Model/AiSearchEnableRequest.md @@ -0,0 +1,10 @@ +# # AiSearchEnableRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**base_url** | **string** | | [optional] +**crawler_config** | **object** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AiSearchIngestPagesRequest.md b/docs/Model/AiSearchIngestPagesRequest.md new file mode 100644 index 00000000..b67d723d --- /dev/null +++ b/docs/Model/AiSearchIngestPagesRequest.md @@ -0,0 +1,10 @@ +# # AiSearchIngestPagesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**job_id** | **string** | | [optional] +**pages** | [**\QuantClient\Model\AiSearchIngestPagesRequestPagesInner[]**](AiSearchIngestPagesRequestPagesInner.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AiSearchIngestPagesRequestPagesInner.md b/docs/Model/AiSearchIngestPagesRequestPagesInner.md new file mode 100644 index 00000000..ee8830c2 --- /dev/null +++ b/docs/Model/AiSearchIngestPagesRequestPagesInner.md @@ -0,0 +1,17 @@ +# # AiSearchIngestPagesRequestPagesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **string** | | +**title** | **string** | | +**content** | **string** | | +**content_type** | **string** | | [optional] +**fetched_at** | **string** | | [optional] +**pre_processed** | **bool** | | [optional] +**summary** | **string** | | [optional] +**tags** | **string[]** | | [optional] +**topics** | **string[]** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AiSearchSearchRequest.md b/docs/Model/AiSearchSearchRequest.md new file mode 100644 index 00000000..325b2ff7 --- /dev/null +++ b/docs/Model/AiSearchSearchRequest.md @@ -0,0 +1,11 @@ +# # AiSearchSearchRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query** | **string** | | +**limit** | **int** | | [optional] +**min_score** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AiSearchTriggerCrawlRequest.md b/docs/Model/AiSearchTriggerCrawlRequest.md new file mode 100644 index 00000000..2dea6af6 --- /dev/null +++ b/docs/Model/AiSearchTriggerCrawlRequest.md @@ -0,0 +1,9 @@ +# # AiSearchTriggerCrawlRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**crawler_uuid** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AiSearchUpdateSettingsRequest.md b/docs/Model/AiSearchUpdateSettingsRequest.md new file mode 100644 index 00000000..310a7727 --- /dev/null +++ b/docs/Model/AiSearchUpdateSettingsRequest.md @@ -0,0 +1,10 @@ +# # AiSearchUpdateSettingsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**public_access** | **object** | | [optional] +**rate_limits** | **object** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Application.md b/docs/Model/Application.md index b09ad551..e28c08ae 100644 --- a/docs/Model/Application.md +++ b/docs/Model/Application.md @@ -8,15 +8,16 @@ Name | Type | Description | Notes **organisation** | **string** | Organisation machine name | **database** | [**\QuantClient\Model\ApplicationDatabase**](ApplicationDatabase.md) | | [optional] **filesystem** | [**\QuantClient\Model\ApplicationFilesystem**](ApplicationFilesystem.md) | | [optional] +**cache** | [**\QuantClient\Model\ApplicationCache**](ApplicationCache.md) | | [optional] **compose_definition** | [**\QuantClient\Model\Compose**](Compose.md) | | [optional] -**status** | **string** | Application status | [optional] -**deployment_information** | [**\QuantClient\Model\ApplicationDeploymentInformationInner[]**](ApplicationDeploymentInformationInner.md) | Deployment history | [optional] +**status** | **string** | Application status | [optional] [readonly] +**deployment_information** | [**\QuantClient\Model\ApplicationDeploymentInformationInner[]**](ApplicationDeploymentInformationInner.md) | Deployment history | [optional] [readonly] **image_reference** | [**\QuantClient\Model\ApplicationImageReference**](ApplicationImageReference.md) | | [optional] -**container_names** | **string[]** | List of container names | [optional] +**container_names** | **string[]** | List of container names | [optional] [readonly] **min_capacity** | **int** | Minimum task count for auto-scaling | [optional] **max_capacity** | **int** | Maximum task count for auto-scaling | [optional] **desired_count** | **int** | Desired task count | [optional] **running_count** | **int** | Currently running task count | [optional] -**environments** | [**\QuantClient\Model\ApplicationEnvironmentsInner[]**](ApplicationEnvironmentsInner.md) | List of environments | [optional] +**environment_names** | **string[]** | List of environment names (read-only) | [optional] [readonly] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ApplicationCache.md b/docs/Model/ApplicationCache.md new file mode 100644 index 00000000..3176cdda --- /dev/null +++ b/docs/Model/ApplicationCache.md @@ -0,0 +1,11 @@ +# # ApplicationCache + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cache_endpoint** | **string** | Cache cluster endpoint | [optional] +**cache_identifier** | **string** | Cache cluster identifier | [optional] +**data_storage_max_gb** | **int** | Maximum cache storage in GB | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ApplicationEnvironmentsInner.md b/docs/Model/ApplicationEnvironmentsInner.md deleted file mode 100644 index d0804aa6..00000000 --- a/docs/Model/ApplicationEnvironmentsInner.md +++ /dev/null @@ -1,12 +0,0 @@ -# # ApplicationEnvironmentsInner - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**env_name** | **string** | Environment name | [optional] -**status** | **string** | Environment status | [optional] -**running_count** | **int** | Running task count | [optional] -**desired_count** | **int** | Desired task count | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ChatInference200ResponseUsage.md b/docs/Model/ChatInference200ResponseUsage.md index db071dbe..4102b4b2 100644 --- a/docs/Model/ChatInference200ResponseUsage.md +++ b/docs/Model/ChatInference200ResponseUsage.md @@ -7,5 +7,6 @@ Name | Type | Description | Notes **input_tokens** | **int** | Number of input tokens | [optional] **output_tokens** | **int** | Number of output tokens | [optional] **total_tokens** | **int** | Total tokens consumed | [optional] +**cost_cents** | **float** | Cost of this inference call in US cents | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ChatInferenceRequest.md b/docs/Model/ChatInferenceRequest.md index 73cbe07c..3ac24f5b 100644 --- a/docs/Model/ChatInferenceRequest.md +++ b/docs/Model/ChatInferenceRequest.md @@ -16,5 +16,8 @@ Name | Type | Description | Notes **tool_config** | [**\QuantClient\Model\ChatInferenceRequestToolConfig**](ChatInferenceRequestToolConfig.md) | | [optional] **session_id** | **string** | Optional session ID for conversation continuity. Omit to use stateless mode, include to continue an existing session. | [optional] **async** | **bool** | Enable async/durable execution mode. When true, returns 202 with pollUrl instead of waiting for completion. Use for long-running inference, client-executed tools, or operations >30 seconds. | [optional] [default to false] +**allowed_tools** | **string[]** | Top-level convenience alias for toolConfig.allowedTools. Whitelists which tools can be auto-executed. | [optional] +**guardrails** | [**\QuantClient\Model\ChatInferenceRequestGuardrails**](ChatInferenceRequestGuardrails.md) | | [optional] +**long_context** | **bool** | Enable 1M context window support regardless of token estimation. Use when sending large payloads (>200K tokens). | [optional] [default to false] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ChatInferenceRequestGuardrails.md b/docs/Model/ChatInferenceRequestGuardrails.md new file mode 100644 index 00000000..4d7d9d99 --- /dev/null +++ b/docs/Model/ChatInferenceRequestGuardrails.md @@ -0,0 +1,11 @@ +# # ChatInferenceRequestGuardrails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**guardrail_identifier** | **string** | Guardrail identifier from AWS Bedrock | [optional] +**guardrail_version** | **string** | Guardrail version | [optional] +**trace** | **string** | Enable guardrail trace output | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ChatInferenceStreamRequest.md b/docs/Model/ChatInferenceStreamRequest.md index f0ea2ae7..22241604 100644 --- a/docs/Model/ChatInferenceStreamRequest.md +++ b/docs/Model/ChatInferenceStreamRequest.md @@ -15,5 +15,8 @@ Name | Type | Description | Notes **tool_config** | [**\QuantClient\Model\ChatInferenceRequestToolConfig**](ChatInferenceRequestToolConfig.md) | | [optional] **session_id** | **string** | Optional session ID for conversation continuity. Omit to use stateless mode, include to continue an existing session. | [optional] **async** | **bool** | Enable async/durable execution mode. When true, returns 202 with pollUrl instead of streaming. Use for long-running inference, client-executed tools, or operations >30 seconds. | [optional] [default to false] +**allowed_tools** | **string[]** | Top-level convenience alias for toolConfig.allowedTools. Whitelists which tools can be auto-executed. | [optional] +**guardrails** | [**\QuantClient\Model\ChatInferenceRequestGuardrails**](ChatInferenceRequestGuardrails.md) | | [optional] +**long_context** | **bool** | Enable 1M context window support regardless of token estimation. Use when sending large payloads (>200K tokens). | [optional] [default to false] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ChatWithAIAgent200ResponseResponseUsage.md b/docs/Model/ChatWithAIAgent200ResponseResponseUsage.md index 1b6f9bb3..86db297b 100644 --- a/docs/Model/ChatWithAIAgent200ResponseResponseUsage.md +++ b/docs/Model/ChatWithAIAgent200ResponseResponseUsage.md @@ -6,5 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **input_tokens** | **int** | | [optional] **output_tokens** | **int** | | [optional] +**total_tokens** | **int** | | [optional] +**cost_cents** | **float** | Cost of this inference call in US cents | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ChatWithAIAgentRequest.md b/docs/Model/ChatWithAIAgentRequest.md index cee5cbd3..77653108 100644 --- a/docs/Model/ChatWithAIAgentRequest.md +++ b/docs/Model/ChatWithAIAgentRequest.md @@ -10,5 +10,8 @@ Name | Type | Description | Notes **stream** | **bool** | Whether to stream the response (SSE) | [optional] [default to false] **async** | **bool** | Enable async/durable execution mode. When true, returns 202 with pollUrl. Use for long-running agent tasks. | [optional] [default to false] **system** | **string** | Optional additional system prompt (appended to agent's configured prompt) | [optional] +**long_context** | **bool** | Per-request override to force 1M context window routing | [optional] [default to false] +**max_tool_iterations** | **int** | Maximum tool auto-execution iterations for this request | [optional] +**allowed_collections** | **string[]** | Per-request override for vector DB collections the agent can query | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Compose.md b/docs/Model/Compose.md index 5b7c097f..9a41bd0c 100644 --- a/docs/Model/Compose.md +++ b/docs/Model/Compose.md @@ -10,6 +10,8 @@ Name | Type | Description | Notes **task_memory** | **int** | Task-level memory in MB | [optional] **min_capacity** | **int** | Minimum number of instances | [optional] **max_capacity** | **int** | Maximum number of instances | [optional] +**single_task_only** | **bool** | Optional. Forces single-task mode for data-safe applications (max one running task). When true: capacity is locked to 1. When false: explicitly allows scaling. When omitted: the platform auto-detects stateful containers and enables single-task mode if found. | [optional] +**startup_grace_period_seconds** | **int** | Optional. Seconds the load balancer waits after a task starts before an unhealthy health check can replace it (applied as the ECS service's healthCheckGracePeriodSeconds when a load balancer is attached). Raise for apps that are slow to boot, e.g. run migrations on startup. Tasks that become healthy sooner still enter service immediately. Defaults to 120 when omitted. | [optional] [default to 120] **spot_configuration** | [**\QuantClient\Model\SpotConfiguration**](SpotConfiguration.md) | | [optional] **enable_cross_env_networking** | **bool** | Optional. Enable cross-environment networking within the same application. When false (default): Uses shared security group for complete isolation (most secure). When true: Uses app-specific security group to enable communication between environments of the same application (e.g., staging can connect to production database). Note: If enableCrossAppNetworking is true, this setting is overridden. | [optional] [default to false] **enable_cross_app_networking** | **bool** | Optional. Enable cross-application networking within the same organization. When false (default): Uses shared/app-specific security group based on enableCrossEnvNetworking. When true: Uses org-specific security group to enable container-to-container communication with ALL applications in the same organization via service discovery (microservices architecture). This setting takes priority over enableCrossEnvNetworking. | [optional] [default to false] diff --git a/docs/Model/ContainerOriginProtectionConfig.md b/docs/Model/ContainerOriginProtectionConfig.md index 56e0023b..948376e7 100644 --- a/docs/Model/ContainerOriginProtectionConfig.md +++ b/docs/Model/ContainerOriginProtectionConfig.md @@ -6,5 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enabled** | **bool** | Whether origin protection is enabled. Defaults to true if this config object is provided. | [optional] [default to true] **ip_allow** | **string[]** | List of IP addresses or CIDR ranges that can bypass origin protection for direct access (e.g., VPN IPs) | [optional] +**redirect_host** | **string** | Optional bare host (e.g. www.example.com). When set, requests denied by origin protection are 302-redirected to https://<redirectHost> with path and query preserved, instead of receiving a 403. Allowed IPs and valid-header (CDN) traffic are unaffected. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateAIAgentRequest.md b/docs/Model/CreateAIAgentRequest.md index 9875560b..07054f09 100644 --- a/docs/Model/CreateAIAgentRequest.md +++ b/docs/Model/CreateAIAgentRequest.md @@ -13,6 +13,10 @@ Name | Type | Description | Notes **max_tokens** | **int** | | [optional] **allowed_tools** | **string[]** | | [optional] **allowed_collections** | **string[]** | | [optional] +**assigned_skills** | **string[]** | Skill IDs to assign to this agent | [optional] **created_by** | **string** | User identifier who created the agent | [optional] +**long_context** | **bool** | Enable 1M context window support | [optional] +**guardrail_preset** | **string** | Guardrail preset name | [optional] +**filter_policies** | **string[]** | Filter policy IDs to apply to this agent's inference requests | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateCustomTool201Response.md b/docs/Model/CreateCustomTool201Response.md index 6984052d..9c28016a 100644 --- a/docs/Model/CreateCustomTool201Response.md +++ b/docs/Model/CreateCustomTool201Response.md @@ -6,6 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **success** | **bool** | | [optional] **tool** | **object** | | [optional] +**edge_function_url** | **string** | Computed edge function URL (read-only) | [optional] +**edge_function_code** | **string** | The deployed edge function code | [optional] +**is_update** | **bool** | Whether this was an update to an existing tool | [optional] **message** | **string** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateCustomToolRequest.md b/docs/Model/CreateCustomToolRequest.md index c9ac524f..0b361774 100644 --- a/docs/Model/CreateCustomToolRequest.md +++ b/docs/Model/CreateCustomToolRequest.md @@ -6,9 +6,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Unique tool name (alphanumeric and underscores only) | **description** | **string** | Human-readable description of what the tool does | -**edge_function_url** | **string** | HTTPS URL of the edge function | -**input_schema** | **object** | JSON Schema defining the tool's input parameters | +**edge_function_code** | **string** | JavaScript source code for the edge function | +**input_schema** | **string** | JSON-encoded JSON Schema object defining the tool's input parameters | **is_async** | **bool** | Whether this tool runs asynchronously (>5 seconds) | [optional] [default to false] **timeout_seconds** | **int** | Tool execution timeout | [optional] [default to 30] +**output_schema** | **string** | JSON-encoded JSON Schema object defining the tool's output structure | [optional] +**output_schema_description** | **string** | Human-readable description of the tool's output | [optional] +**category** | **string** | Category to group related tools | [optional] +**response_mode** | **string** | How the tool response is handled: llm (passed back to model) or direct (returned to user) | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateEnvironmentRequest.md b/docs/Model/CreateEnvironmentRequest.md index c2fa4ecb..c9125799 100644 --- a/docs/Model/CreateEnvironmentRequest.md +++ b/docs/Model/CreateEnvironmentRequest.md @@ -7,6 +7,8 @@ Name | Type | Description | Notes **env_name** | **string** | Environment name (e.g., 'staging', 'development') | **min_capacity** | **int** | Minimum number of instances | [optional] **max_capacity** | **int** | Maximum number of instances | [optional] +**single_task_only** | **bool** | Optional. Forces single-task mode (max one running task). When omitted, the platform auto-detects stateful containers. | [optional] +**startup_grace_period_seconds** | **int** | Optional. Seconds the load balancer waits after a task starts before an unhealthy health check can replace it. If not set, the value from composeDefinition (or default 120) is used. | [optional] [default to 120] **clone_configuration_from** | **string** | Clone configuration from an existing environment | [optional] **compose_definition** | [**\QuantClient\Model\Compose**](Compose.md) | | [optional] **image_suffix** | **string** | Optional image tag suffix for cloning | [optional] diff --git a/docs/Model/CreateFilterPolicyRequest.md b/docs/Model/CreateFilterPolicyRequest.md new file mode 100644 index 00000000..142b9e7b --- /dev/null +++ b/docs/Model/CreateFilterPolicyRequest.md @@ -0,0 +1,12 @@ +# # CreateFilterPolicyRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | +**description** | **string** | | [optional] +**enabled** | **bool** | | [optional] +**rules** | [**\QuantClient\Model\CreateFilterPolicyRequestRulesInner[]**](CreateFilterPolicyRequestRulesInner.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateFilterPolicyRequestRulesInner.md b/docs/Model/CreateFilterPolicyRequestRulesInner.md new file mode 100644 index 00000000..9cc530ea --- /dev/null +++ b/docs/Model/CreateFilterPolicyRequestRulesInner.md @@ -0,0 +1,12 @@ +# # CreateFilterPolicyRequestRulesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**match** | [**\QuantClient\Model\CreateFilterPolicyRequestRulesInnerMatch**](CreateFilterPolicyRequestRulesInnerMatch.md) | | [optional] +**action** | **string** | | [optional] +**apply_to** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateFilterPolicyRequestRulesInnerMatch.md b/docs/Model/CreateFilterPolicyRequestRulesInnerMatch.md new file mode 100644 index 00000000..e7983312 --- /dev/null +++ b/docs/Model/CreateFilterPolicyRequestRulesInnerMatch.md @@ -0,0 +1,11 @@ +# # CreateFilterPolicyRequestRulesInnerMatch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | | [optional] +**values** | **string[]** | Required when type=word | [optional] +**pattern** | **string** | Required when type=regex | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateOrchestrationRequest.md b/docs/Model/CreateOrchestrationRequest.md new file mode 100644 index 00000000..dab08d6e --- /dev/null +++ b/docs/Model/CreateOrchestrationRequest.md @@ -0,0 +1,20 @@ +# # CreateOrchestrationRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Orchestration name | +**description** | **string** | Optional description | [optional] +**agent_id** | **string** | Agent to process items | [optional] +**tool_id** | **string** | Tool to execute for items | [optional] +**workflow_id** | **string** | Workflow to run for items | [optional] +**input_source** | [**\QuantClient\Model\CreateOrchestrationRequestInputSource**](CreateOrchestrationRequestInputSource.md) | | +**batch_size** | **int** | Items per batch | [optional] [default to 10] +**concurrency** | **int** | Concurrent items within a batch | [optional] [default to 1] +**stop_condition** | [**\QuantClient\Model\CreateOrchestrationRequestStopCondition**](CreateOrchestrationRequestStopCondition.md) | | [optional] +**assigned_skills** | **string[]** | Skill IDs to assign | [optional] +**context** | **object** | Optional context merged into each item before processing (e.g. shared credentials or endpoints) | [optional] +**auto_start** | **bool** | Whether to start immediately | [optional] [default to true] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateOrchestrationRequestInputSource.md b/docs/Model/CreateOrchestrationRequestInputSource.md new file mode 100644 index 00000000..17a5c3ad --- /dev/null +++ b/docs/Model/CreateOrchestrationRequestInputSource.md @@ -0,0 +1,12 @@ +# # CreateOrchestrationRequestInputSource + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | Input source type (api type not yet supported) | +**items** | **object[]** | Static items (for type=static) | [optional] +**task_query** | **object** | Task query filters (for type=task_query) | [optional] +**generator_prompt** | **string** | AI prompt (for type=generator) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateOrchestrationRequestStopCondition.md b/docs/Model/CreateOrchestrationRequestStopCondition.md new file mode 100644 index 00000000..8f27ca6e --- /dev/null +++ b/docs/Model/CreateOrchestrationRequestStopCondition.md @@ -0,0 +1,11 @@ +# # CreateOrchestrationRequestStopCondition + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | | [optional] [default to 'all_complete'] +**max_iterations** | **int** | Max iterations (for type=max_iterations) | [optional] +**condition_prompt** | **string** | AI prompt to evaluate stop (for type=condition) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateSkill201Response.md b/docs/Model/CreateSkill201Response.md new file mode 100644 index 00000000..c7c1185f --- /dev/null +++ b/docs/Model/CreateSkill201Response.md @@ -0,0 +1,11 @@ +# # CreateSkill201Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**skill** | **object** | | [optional] +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateSkillRequest.md b/docs/Model/CreateSkillRequest.md new file mode 100644 index 00000000..49215b6e --- /dev/null +++ b/docs/Model/CreateSkillRequest.md @@ -0,0 +1,19 @@ +# # CreateSkillRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | +**description** | **string** | | [optional] +**content** | **string** | | +**trigger_condition** | **string** | | +**tags** | **string[]** | | [optional] +**required_tools** | **string[]** | | [optional] +**namespace** | **string** | | [optional] +**files** | **object** | | [optional] +**disable_model_invocation** | **bool** | | [optional] +**allowed_tools** | **string[]** | | [optional] +**installed_by** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateSlackBot201Response.md b/docs/Model/CreateSlackBot201Response.md new file mode 100644 index 00000000..f188f3df --- /dev/null +++ b/docs/Model/CreateSlackBot201Response.md @@ -0,0 +1,9 @@ +# # CreateSlackBot201Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bot** | **object** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateSlackBotRequest.md b/docs/Model/CreateSlackBotRequest.md new file mode 100644 index 00000000..bc040f3c --- /dev/null +++ b/docs/Model/CreateSlackBotRequest.md @@ -0,0 +1,30 @@ +# # CreateSlackBotRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Display name for the bot | +**setup_type** | **string** | Whether to use Quant-managed or customer-provided Slack app | +**system_prompt** | **string** | System prompt for the backing AI agent | +**model_id** | **string** | AI model identifier | +**temperature** | **float** | Sampling temperature | [optional] +**max_tokens** | **int** | Maximum response tokens | [optional] +**allowed_tools** | **string[]** | Tools the agent may use | [optional] +**assigned_skills** | **string[]** | Skills assigned to the agent | [optional] +**allowed_collections** | **string[]** | Vector DB collections the agent may query | [optional] +**allowed_sub_agents** | **string[]** | Sub-agents the agent may call | [optional] +**guardrail_preset** | **string** | Guardrail preset name | [optional] +**filter_policies** | **string[]** | Content filter policies | [optional] +**long_context** | **bool** | Enable long context mode | [optional] +**session_ttl_days** | **int** | Session TTL in days | [optional] +**allowed_channels** | **string[]** | Slack channel IDs the bot may respond in | [optional] +**allowed_users** | **string[]** | Slack user IDs allowed to interact with the bot | [optional] +**denied_users** | **string[]** | Slack user IDs denied from interacting with the bot | [optional] +**allow_guests** | **bool** | Whether guest users may interact with the bot | [optional] +**home_tab_content** | **string** | Content shown on the bot's Home tab in Slack | [optional] +**agent_access_control** | **object** | Agent-level access control settings | [optional] +**keywords_enabled** | **bool** | Whether keyword triggers are enabled | [optional] +**keywords** | **string[]** | Keywords that trigger the bot | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateVectorCollectionRequest.md b/docs/Model/CreateVectorCollectionRequest.md index af57e8ec..0d988f1f 100644 --- a/docs/Model/CreateVectorCollectionRequest.md +++ b/docs/Model/CreateVectorCollectionRequest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Collection name (used for reference) | **description** | **string** | | [optional] -**embedding_model** | **string** | Embedding model to use (default: amazon.titan-embed-text-v2:0) | [optional] +**embedding_model** | **string** | Embedding model to use. Supported: amazon.titan-embed-text-v2:0, cohere.embed-english-v3, cohere.embed-multilingual-v3 | **dimensions** | **int** | Embedding dimensions (default: 1024) | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Cron.md b/docs/Model/Cron.md index fb353adc..851af507 100644 --- a/docs/Model/Cron.md +++ b/docs/Model/Cron.md @@ -5,7 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | | [optional] -**schedule** | **string** | | [optional] -**command** | **string** | | [optional] +**description** | **string** | | [optional] +**schedule_expression** | **string** | | [optional] +**command** | **string[]** | | [optional] +**target_container_name** | **string** | | [optional] +**is_enabled** | **bool** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteVectorCollection200Response.md b/docs/Model/DeleteAgentOverlay200Response.md similarity index 89% rename from docs/Model/DeleteVectorCollection200Response.md rename to docs/Model/DeleteAgentOverlay200Response.md index 189ed94f..ba83f860 100644 --- a/docs/Model/DeleteVectorCollection200Response.md +++ b/docs/Model/DeleteAgentOverlay200Response.md @@ -1,4 +1,4 @@ -# # DeleteVectorCollection200Response +# # DeleteAgentOverlay200Response ## Properties diff --git a/docs/Model/DeleteSkill200Response.md b/docs/Model/DeleteSkill200Response.md new file mode 100644 index 00000000..8dd45c23 --- /dev/null +++ b/docs/Model/DeleteSkill200Response.md @@ -0,0 +1,10 @@ +# # DeleteSkill200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteSkillCollection200Response.md b/docs/Model/DeleteSkillCollection200Response.md new file mode 100644 index 00000000..79d5b4a1 --- /dev/null +++ b/docs/Model/DeleteSkillCollection200Response.md @@ -0,0 +1,10 @@ +# # DeleteSkillCollection200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteSlackBot200Response.md b/docs/Model/DeleteSlackBot200Response.md new file mode 100644 index 00000000..2ff8cc96 --- /dev/null +++ b/docs/Model/DeleteSlackBot200Response.md @@ -0,0 +1,10 @@ +# # DeleteSlackBot200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteVectorDocuments200Response.md b/docs/Model/DeleteVectorDocuments200Response.md new file mode 100644 index 00000000..b6522bf1 --- /dev/null +++ b/docs/Model/DeleteVectorDocuments200Response.md @@ -0,0 +1,11 @@ +# # DeleteVectorDocuments200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **string** | | [optional] +**collection_id** | **string** | | [optional] +**deleted_count** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteVectorDocumentsRequest.md b/docs/Model/DeleteVectorDocumentsRequest.md new file mode 100644 index 00000000..c38ea94a --- /dev/null +++ b/docs/Model/DeleteVectorDocumentsRequest.md @@ -0,0 +1,12 @@ +# # DeleteVectorDocumentsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**purge_all** | **bool** | Delete ALL documents in collection | [optional] +**document_ids** | **string[]** | Delete specific documents by UUID | [optional] +**keys** | **string[]** | Delete documents by key | [optional] +**metadata** | [**\QuantClient\Model\DeleteVectorDocumentsRequestMetadata**](DeleteVectorDocumentsRequestMetadata.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteVectorDocumentsRequestMetadata.md b/docs/Model/DeleteVectorDocumentsRequestMetadata.md new file mode 100644 index 00000000..1d182523 --- /dev/null +++ b/docs/Model/DeleteVectorDocumentsRequestMetadata.md @@ -0,0 +1,10 @@ +# # DeleteVectorDocumentsRequestMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field** | **string** | Metadata field name (e.g., 'drupal_entity_id') | [optional] +**values** | **string[]** | Values to match (OR logic) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EnvironmentResponse.md b/docs/Model/EnvironmentResponse.md index e7e3e1a0..d96612ca 100644 --- a/docs/Model/EnvironmentResponse.md +++ b/docs/Model/EnvironmentResponse.md @@ -5,26 +5,26 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **env_name** | **string** | Environment name | -**status** | **string** | Environment status | [optional] -**running_count** | **int** | Number of running tasks | [optional] -**desired_count** | **int** | Desired number of tasks | [optional] +**status** | **string** | Environment status | [optional] [readonly] +**running_count** | **int** | Number of running tasks | [optional] [readonly] +**desired_count** | **int** | Desired number of tasks | [optional] [readonly] **min_capacity** | **int** | Minimum capacity for autoscaling | [optional] **max_capacity** | **int** | Maximum capacity for autoscaling | [optional] -**public_ip_address** | **string** | Public IP address for SSH access | [optional] -**deployment_status** | **string** | Current deployment status. FAILED indicates the most recent deployment did not complete successfully. | [optional] -**deployment_failure_type** | **string** | Type of deployment failure when deploymentStatus is FAILED (e.g., 'ECS_DEPLOYMENT_CIRCUIT_BREAKER', 'IMAGE_PULL_ERROR') | [optional] -**deployment_failure_reason** | **string** | Human-readable explanation of why the deployment failed. Contains details such as wrong image architecture, missing image, or container startup errors. | [optional] -**task_definition** | **object** | ECS task definition details | [optional] -**service** | **object** | ECS service details | [optional] -**load_balancer** | **object** | Load balancer configuration | [optional] -**security_group** | **object** | Security group configuration | [optional] -**subnet** | **object** | Subnet configuration | [optional] -**vpc** | **object** | VPC configuration | [optional] -**containers** | **object[]** | Container configurations | [optional] -**volumes** | [**\QuantClient\Model\Volume[]**](Volume.md) | Persistent storage volumes | [optional] -**cron** | [**\QuantClient\Model\Cron[]**](Cron.md) | Scheduled cron jobs | [optional] -**alb_routing** | **object** | ALB routing configuration | [optional] -**created_at** | **\DateTime** | Creation timestamp | [optional] -**updated_at** | **\DateTime** | Last update timestamp | [optional] +**public_ip_address** | **string** | Public IP address for SSH access | [optional] [readonly] +**deployment_status** | **string** | Current deployment status | [optional] [readonly] +**deployment_failure_type** | **string** | Type of deployment failure | [optional] [readonly] +**deployment_failure_reason** | **string** | Reason for deployment failure | [optional] [readonly] +**task_definition** | **object** | ECS task definition details | [optional] [readonly] +**service** | **object** | ECS service details | [optional] [readonly] +**load_balancer** | **object** | Load balancer configuration | [optional] [readonly] +**security_group** | **object** | Security group configuration | [optional] [readonly] +**subnet** | **object** | Subnet configuration | [optional] [readonly] +**vpc** | **object** | VPC configuration | [optional] [readonly] +**container_names** | **string[]** | Container name list | [optional] [readonly] +**volumes** | [**\QuantClient\Model\Volume[]**](Volume.md) | Persistent storage volumes | [optional] [readonly] +**cron** | [**\QuantClient\Model\Cron[]**](Cron.md) | Scheduled cron jobs | [optional] [readonly] +**alb_routing** | **object** | ALB routing configuration | [optional] [readonly] +**created_at** | **\DateTime** | Creation timestamp | [optional] [readonly] +**updated_at** | **\DateTime** | Last update timestamp | [optional] [readonly] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetAIAgent200ResponseAgent.md b/docs/Model/GetAIAgent200ResponseAgent.md index 9d34d85e..3de1a7ff 100644 --- a/docs/Model/GetAIAgent200ResponseAgent.md +++ b/docs/Model/GetAIAgent200ResponseAgent.md @@ -14,6 +14,11 @@ Name | Type | Description | Notes **max_tokens** | **int** | | [optional] **allowed_tools** | **string[]** | | [optional] **allowed_collections** | **string[]** | | [optional] +**assigned_skills** | **string[]** | | [optional] +**long_context** | **bool** | Whether 1M context window is enabled | [optional] +**guardrail_preset** | **string** | Guardrail preset name | [optional] +**is_global** | **bool** | Whether this is a platform-managed global agent | [optional] +**has_overlay** | **bool** | Whether the requesting org has a per-org overlay for this global agent | [optional] **created_by** | **string** | | [optional] **created_at** | **\DateTime** | | [optional] **updated_at** | **\DateTime** | | [optional] diff --git a/docs/Model/GetAIOrchestrationStatus200Response.md b/docs/Model/GetAIOrchestrationStatus200Response.md index 5ab62ed4..85aee321 100644 --- a/docs/Model/GetAIOrchestrationStatus200Response.md +++ b/docs/Model/GetAIOrchestrationStatus200Response.md @@ -8,10 +8,11 @@ Name | Type | Description | Notes **status** | **string** | Current orchestration status | **tool_count** | **int** | Total number of async tools in this orchestration | **completed_tools** | **int** | Number of tools that have completed | [optional] -**synthesized_response** | **string** | AI-synthesized response combining all tool results (only present when status=complete) | [optional] +**result** | **string** | AI-synthesized response combining all tool results (only present when status=complete) | [optional] **tools** | [**\QuantClient\Model\GetAIOrchestrationStatus200ResponseToolsInner[]**](GetAIOrchestrationStatus200ResponseToolsInner.md) | Status of individual tool executions | [optional] **error** | **string** | Error message (only present when status=failed) | [optional] **created_at** | **\DateTime** | When orchestration was created | **completed_at** | **\DateTime** | When orchestration completed (if status in complete or failed) | [optional] +**duration** | **int** | Seconds from creation to completion (present only once completed) | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetAIUsageStats200Response.md b/docs/Model/GetAIUsageStats200Response.md deleted file mode 100644 index 43972fed..00000000 --- a/docs/Model/GetAIUsageStats200Response.md +++ /dev/null @@ -1,11 +0,0 @@ -# # GetAIUsageStats200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**total_requests** | **int** | Total number of API requests | [optional] -**total_tokens** | **int** | Total tokens consumed across all requests | [optional] -**by_model** | [**array**](GetAIUsageStats200ResponseByModelValue.md) | Usage breakdown by model ID | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetAgentOverlay200Response.md b/docs/Model/GetAgentOverlay200Response.md new file mode 100644 index 00000000..70a582a3 --- /dev/null +++ b/docs/Model/GetAgentOverlay200Response.md @@ -0,0 +1,10 @@ +# # GetAgentOverlay200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**overlay** | [**\QuantClient\Model\GetAgentOverlay200ResponseOverlay**](GetAgentOverlay200ResponseOverlay.md) | | [optional] +**base** | [**\QuantClient\Model\GetAgentOverlay200ResponseBase**](GetAgentOverlay200ResponseBase.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetAgentOverlay200ResponseBase.md b/docs/Model/GetAgentOverlay200ResponseBase.md new file mode 100644 index 00000000..483b9554 --- /dev/null +++ b/docs/Model/GetAgentOverlay200ResponseBase.md @@ -0,0 +1,13 @@ +# # GetAgentOverlay200ResponseBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **string** | | [optional] +**name** | **string** | | [optional] +**model_id** | **string** | | [optional] +**allowed_tools** | **string[]** | | [optional] +**assigned_skill_ids** | **string[]** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetAgentOverlay200ResponseOverlay.md b/docs/Model/GetAgentOverlay200ResponseOverlay.md new file mode 100644 index 00000000..3e30b83c --- /dev/null +++ b/docs/Model/GetAgentOverlay200ResponseOverlay.md @@ -0,0 +1,19 @@ +# # GetAgentOverlay200ResponseOverlay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**model_id** | **string** | | [optional] +**temperature** | **float** | | [optional] +**max_tokens** | **int** | | [optional] +**disabled_skills** | **string[]** | | [optional] +**additional_skills** | **string[]** | | [optional] +**additional_tools** | **string[]** | | [optional] +**disabled_tools** | **string[]** | | [optional] +**system_prompt_append** | **string** | | [optional] +**allowed_collections** | **string[]** | | [optional] +**guardrail_preset** | **string** | | [optional] +**version** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetCustomTool200Response.md b/docs/Model/GetCustomTool200Response.md new file mode 100644 index 00000000..47e79ac4 --- /dev/null +++ b/docs/Model/GetCustomTool200Response.md @@ -0,0 +1,9 @@ +# # GetCustomTool200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tool** | [**\QuantClient\Model\GetCustomTool200ResponseTool**](GetCustomTool200ResponseTool.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetCustomTool200ResponseTool.md b/docs/Model/GetCustomTool200ResponseTool.md new file mode 100644 index 00000000..da13cd3e --- /dev/null +++ b/docs/Model/GetCustomTool200ResponseTool.md @@ -0,0 +1,19 @@ +# # GetCustomTool200ResponseTool + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**description** | **string** | | [optional] +**edge_function_url** | **string** | | [optional] +**edge_function_code** | **string** | The deployed edge function source code | [optional] +**is_async** | **bool** | | [optional] +**input_schema** | **string** | | [optional] +**output_schema** | **string** | | [optional] +**output_schema_description** | **string** | | [optional] +**category** | **string** | | [optional] +**response_mode** | **string** | | [optional] +**created_at** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetDurableExecutionStatus200ResponseResultUsage.md b/docs/Model/GetDurableExecutionStatus200ResponseResultUsage.md index a05fd40c..a1054196 100644 --- a/docs/Model/GetDurableExecutionStatus200ResponseResultUsage.md +++ b/docs/Model/GetDurableExecutionStatus200ResponseResultUsage.md @@ -7,5 +7,6 @@ Name | Type | Description | Notes **input_tokens** | **int** | | [optional] **output_tokens** | **int** | | [optional] **total_tokens** | **int** | | [optional] +**cost_cents** | **float** | Cost of the final synthesis turn in US cents | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetGovernanceConfig200Response.md b/docs/Model/GetGovernanceConfig200Response.md new file mode 100644 index 00000000..101aa458 --- /dev/null +++ b/docs/Model/GetGovernanceConfig200Response.md @@ -0,0 +1,16 @@ +# # GetGovernanceConfig200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**org_id** | **string** | | [optional] +**ai_enabled** | **bool** | | [optional] +**model_policy** | **string** | | [optional] +**model_list** | **string[]** | | [optional] +**mandatory_guardrail_preset** | **string** | | [optional] +**mandatory_filter_policies** | **string[]** | | [optional] +**spend_limits** | [**\QuantClient\Model\GetGovernanceConfig200ResponseSpendLimits**](GetGovernanceConfig200ResponseSpendLimits.md) | | [optional] +**version** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetGovernanceConfig200ResponseSpendLimits.md b/docs/Model/GetGovernanceConfig200ResponseSpendLimits.md new file mode 100644 index 00000000..feb4f410 --- /dev/null +++ b/docs/Model/GetGovernanceConfig200ResponseSpendLimits.md @@ -0,0 +1,18 @@ +# # GetGovernanceConfig200ResponseSpendLimits + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**monthly_budget_cents** | **int** | | [optional] +**daily_budget_cents** | **int** | | [optional] +**per_user_monthly_budget_cents** | **int** | | [optional] +**per_user_daily_budget_cents** | **int** | | [optional] +**warning_threshold_percent** | **int** | | [optional] +**interface_limits** | [**array**](GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue.md) | Aggregate spend caps per interface label (slack, autonomous, api-gateway, streaming, websocket). Keys are interface labels. | [optional] +**user_overrides** | [**array**](GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue.md) | Per-user budget overrides keyed by userId (numeric portal id, slack-<id>, or system:code-agent). Replaces the flat per-user budget for that user; unlimited=true exempts them. | [optional] +**per_token_monthly_budget_cents** | **int** | Flat monthly cap in cents applied to every API token without a named override | [optional] +**per_token_daily_budget_cents** | **int** | Flat daily cap in cents applied to every API token without a named override | [optional] +**token_overrides** | [**array**](GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue.md) | Per-token budget overrides keyed by API token id. Replaces the flat per-token budget for that token; unlimited=true exempts it. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue.md b/docs/Model/GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue.md new file mode 100644 index 00000000..8c030cdf --- /dev/null +++ b/docs/Model/GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue.md @@ -0,0 +1,10 @@ +# # GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**daily_cents** | **int** | | [optional] +**monthly_cents** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue.md b/docs/Model/GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue.md new file mode 100644 index 00000000..caa7718f --- /dev/null +++ b/docs/Model/GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue.md @@ -0,0 +1,11 @@ +# # GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**daily_cents** | **int** | | [optional] +**monthly_cents** | **int** | | [optional] +**unlimited** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetGovernanceSpend200Response.md b/docs/Model/GetGovernanceSpend200Response.md new file mode 100644 index 00000000..0f785b03 --- /dev/null +++ b/docs/Model/GetGovernanceSpend200Response.md @@ -0,0 +1,13 @@ +# # GetGovernanceSpend200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**org_total** | [**\QuantClient\Model\GetGovernanceSpend200ResponseOrgTotal**](GetGovernanceSpend200ResponseOrgTotal.md) | | [optional] +**today_total** | [**\QuantClient\Model\GetGovernanceSpend200ResponseTodayTotal**](GetGovernanceSpend200ResponseTodayTotal.md) | | [optional] +**budget** | [**\QuantClient\Model\GetGovernanceSpend200ResponseBudget**](GetGovernanceSpend200ResponseBudget.md) | | [optional] +**daily_budget** | [**\QuantClient\Model\GetGovernanceSpend200ResponseDailyBudget**](GetGovernanceSpend200ResponseDailyBudget.md) | | [optional] +**user_total** | [**\QuantClient\Model\GetGovernanceSpend200ResponseUserTotal**](GetGovernanceSpend200ResponseUserTotal.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetGovernanceSpend200ResponseBudget.md b/docs/Model/GetGovernanceSpend200ResponseBudget.md new file mode 100644 index 00000000..2bb96ce1 --- /dev/null +++ b/docs/Model/GetGovernanceSpend200ResponseBudget.md @@ -0,0 +1,11 @@ +# # GetGovernanceSpend200ResponseBudget + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**monthly_budget_cents** | **int** | | [optional] +**used_percent** | **float** | | [optional] +**remaining_cents** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetGovernanceSpend200ResponseDailyBudget.md b/docs/Model/GetGovernanceSpend200ResponseDailyBudget.md new file mode 100644 index 00000000..214cec0a --- /dev/null +++ b/docs/Model/GetGovernanceSpend200ResponseDailyBudget.md @@ -0,0 +1,11 @@ +# # GetGovernanceSpend200ResponseDailyBudget + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**daily_budget_cents** | **int** | | [optional] +**used_percent** | **float** | | [optional] +**remaining_cents** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetGovernanceSpend200ResponseOrgTotal.md b/docs/Model/GetGovernanceSpend200ResponseOrgTotal.md new file mode 100644 index 00000000..29966ef0 --- /dev/null +++ b/docs/Model/GetGovernanceSpend200ResponseOrgTotal.md @@ -0,0 +1,10 @@ +# # GetGovernanceSpend200ResponseOrgTotal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**spend_cents** | **int** | Total org spend in US cents | [optional] +**request_count** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetGovernanceSpend200ResponseTodayTotal.md b/docs/Model/GetGovernanceSpend200ResponseTodayTotal.md new file mode 100644 index 00000000..4fd0bf78 --- /dev/null +++ b/docs/Model/GetGovernanceSpend200ResponseTodayTotal.md @@ -0,0 +1,10 @@ +# # GetGovernanceSpend200ResponseTodayTotal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**spend_cents** | **int** | Org spend today in US cents | [optional] +**request_count** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetGovernanceSpend200ResponseUserTotal.md b/docs/Model/GetGovernanceSpend200ResponseUserTotal.md new file mode 100644 index 00000000..85f39309 --- /dev/null +++ b/docs/Model/GetGovernanceSpend200ResponseUserTotal.md @@ -0,0 +1,10 @@ +# # GetGovernanceSpend200ResponseUserTotal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**monthly_spend_cents** | **int** | | [optional] +**daily_spend_cents** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetMyUsage200Response.md b/docs/Model/GetMyUsage200Response.md new file mode 100644 index 00000000..e92d011c --- /dev/null +++ b/docs/Model/GetMyUsage200Response.md @@ -0,0 +1,13 @@ +# # GetMyUsage200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **string** | | [optional] +**current_month** | **string** | | [optional] +**monthly** | [**\QuantClient\Model\GetMyUsage200ResponseMonthly**](GetMyUsage200ResponseMonthly.md) | | [optional] +**daily** | [**\QuantClient\Model\GetMyUsage200ResponseDaily**](GetMyUsage200ResponseDaily.md) | | [optional] +**quota** | [**\QuantClient\Model\GetMyUsage200ResponseQuota**](GetMyUsage200ResponseQuota.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetMyUsage200ResponseDaily.md b/docs/Model/GetMyUsage200ResponseDaily.md new file mode 100644 index 00000000..b26604f2 --- /dev/null +++ b/docs/Model/GetMyUsage200ResponseDaily.md @@ -0,0 +1,9 @@ +# # GetMyUsage200ResponseDaily + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**spend_cents** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetMyUsage200ResponseMonthly.md b/docs/Model/GetMyUsage200ResponseMonthly.md new file mode 100644 index 00000000..e29705ac --- /dev/null +++ b/docs/Model/GetMyUsage200ResponseMonthly.md @@ -0,0 +1,10 @@ +# # GetMyUsage200ResponseMonthly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**spend_cents** | **int** | | [optional] +**request_count** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetMyUsage200ResponseQuota.md b/docs/Model/GetMyUsage200ResponseQuota.md new file mode 100644 index 00000000..e36e3253 --- /dev/null +++ b/docs/Model/GetMyUsage200ResponseQuota.md @@ -0,0 +1,10 @@ +# # GetMyUsage200ResponseQuota + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**monthly_limit** | [**\QuantClient\Model\GetMyUsage200ResponseQuotaMonthlyLimit**](GetMyUsage200ResponseQuotaMonthlyLimit.md) | | [optional] +**daily_limit** | [**\QuantClient\Model\GetMyUsage200ResponseQuotaDailyLimit**](GetMyUsage200ResponseQuotaDailyLimit.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetMyUsage200ResponseQuotaDailyLimit.md b/docs/Model/GetMyUsage200ResponseQuotaDailyLimit.md new file mode 100644 index 00000000..18382f3f --- /dev/null +++ b/docs/Model/GetMyUsage200ResponseQuotaDailyLimit.md @@ -0,0 +1,12 @@ +# # GetMyUsage200ResponseQuotaDailyLimit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**limit_cents** | **int** | The configured daily cap in US cents | [optional] +**used_percent** | **float** | Percentage of the cap consumed today (0–100+) | [optional] +**remaining_cents** | **int** | Cents remaining before the cap is hit; can be negative if overspent | [optional] +**resets_at** | **\DateTime** | UTC timestamp when the daily counter resets (always next UTC midnight) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetMyUsage200ResponseQuotaMonthlyLimit.md b/docs/Model/GetMyUsage200ResponseQuotaMonthlyLimit.md new file mode 100644 index 00000000..40675b56 --- /dev/null +++ b/docs/Model/GetMyUsage200ResponseQuotaMonthlyLimit.md @@ -0,0 +1,11 @@ +# # GetMyUsage200ResponseQuotaMonthlyLimit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**limit_cents** | **int** | The configured monthly cap in US cents | [optional] +**used_percent** | **float** | Percentage of the cap consumed this month (0–100+) | [optional] +**remaining_cents** | **int** | Cents remaining before the cap is hit; can be negative if overspent | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetRestoreStatus200Response.md b/docs/Model/GetRestoreStatus200Response.md new file mode 100644 index 00000000..4189adec --- /dev/null +++ b/docs/Model/GetRestoreStatus200Response.md @@ -0,0 +1,19 @@ +# # GetRestoreStatus200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**restore_id** | **string** | | [optional] +**org_name** | **string** | | [optional] +**app_name** | **string** | | [optional] +**env_name** | **string** | | [optional] +**backup_id** | **string** | | [optional] +**status** | **string** | | [optional] +**started_at** | **\DateTime** | | [optional] +**completed_at** | **\DateTime** | | [optional] +**error_message** | **string** | | [optional] +**task_arn** | **string** | | [optional] +**ttl** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ScalingPolicy.md b/docs/Model/GetScalingPolicyResponse.md similarity index 64% rename from docs/Model/ScalingPolicy.md rename to docs/Model/GetScalingPolicyResponse.md index 8a98636e..6039364b 100644 --- a/docs/Model/ScalingPolicy.md +++ b/docs/Model/GetScalingPolicyResponse.md @@ -1,4 +1,4 @@ -# # ScalingPolicy +# # GetScalingPolicyResponse ## Properties @@ -8,5 +8,7 @@ Name | Type | Description | Notes **target_value** | **float** | | [optional] **scale_in_cooldown_seconds** | **int** | | [optional] **scale_out_cooldown_seconds** | **int** | | [optional] +**policy_name** | **string** | Name of the underlying Application Auto Scaling policy. | [optional] +**resource_label** | **string** | ALB ResourceLabel for RPS policies (target group identifier). | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetSkill200Response.md b/docs/Model/GetSkill200Response.md new file mode 100644 index 00000000..551c88bd --- /dev/null +++ b/docs/Model/GetSkill200Response.md @@ -0,0 +1,9 @@ +# # GetSkill200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**skill** | [**\QuantClient\Model\GetSkill200ResponseSkill**](GetSkill200ResponseSkill.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetSkill200ResponseSkill.md b/docs/Model/GetSkill200ResponseSkill.md new file mode 100644 index 00000000..ab5f9f7c --- /dev/null +++ b/docs/Model/GetSkill200ResponseSkill.md @@ -0,0 +1,22 @@ +# # GetSkill200ResponseSkill + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**skill_id** | **string** | | [optional] +**name** | **string** | | [optional] +**description** | **string** | | [optional] +**content** | **string** | | [optional] +**trigger_condition** | **string** | | [optional] +**tags** | **string[]** | | [optional] +**source** | **object** | | [optional] +**required_tools** | **string[]** | | [optional] +**files** | **object** | | [optional] +**namespace** | **string** | | [optional] +**disable_model_invocation** | **bool** | | [optional] +**allowed_tools** | **string[]** | | [optional] +**installed_at** | **\DateTime** | | [optional] +**updated_at** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetSlackBot200Response.md b/docs/Model/GetSlackBot200Response.md new file mode 100644 index 00000000..96600cd7 --- /dev/null +++ b/docs/Model/GetSlackBot200Response.md @@ -0,0 +1,9 @@ +# # GetSlackBot200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bot** | [**\QuantClient\Model\GetSlackBot200ResponseBot**](GetSlackBot200ResponseBot.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetSlackBot200ResponseBot.md b/docs/Model/GetSlackBot200ResponseBot.md new file mode 100644 index 00000000..9799d977 --- /dev/null +++ b/docs/Model/GetSlackBot200ResponseBot.md @@ -0,0 +1,35 @@ +# # GetSlackBot200ResponseBot + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bot_id** | **string** | | [optional] +**name** | **string** | | [optional] +**setup_type** | **string** | | [optional] +**status** | **string** | | [optional] +**connected** | **bool** | | [optional] +**system_prompt** | **string** | | [optional] +**model_id** | **string** | | [optional] +**temperature** | **float** | | [optional] +**max_tokens** | **int** | | [optional] +**allowed_tools** | **string[]** | | [optional] +**assigned_skills** | **string[]** | | [optional] +**allowed_collections** | **string[]** | | [optional] +**allowed_sub_agents** | **string[]** | | [optional] +**guardrail_preset** | **string** | | [optional] +**filter_policies** | **string[]** | | [optional] +**long_context** | **bool** | | [optional] +**session_ttl_days** | **int** | | [optional] +**allowed_channels** | **string[]** | | [optional] +**allowed_users** | **string[]** | | [optional] +**denied_users** | **string[]** | | [optional] +**allow_guests** | **bool** | | [optional] +**home_tab_content** | **string** | | [optional] +**agent_access_control** | **object** | | [optional] +**keywords_enabled** | **bool** | | [optional] +**keywords** | **string[]** | | [optional] +**created_at** | **\DateTime** | | [optional] +**updated_at** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ImportSkill201Response.md b/docs/Model/ImportSkill201Response.md new file mode 100644 index 00000000..a1d03858 --- /dev/null +++ b/docs/Model/ImportSkill201Response.md @@ -0,0 +1,10 @@ +# # ImportSkill201Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**skill** | **object** | | [optional] +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ImportSkillCollection201Response.md b/docs/Model/ImportSkillCollection201Response.md new file mode 100644 index 00000000..63d82064 --- /dev/null +++ b/docs/Model/ImportSkillCollection201Response.md @@ -0,0 +1,13 @@ +# # ImportSkillCollection201Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**namespace** | **string** | | [optional] +**imported** | **int** | | [optional] +**failed** | **int** | | [optional] +**skills** | **object[]** | | [optional] +**errors** | **object[]** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ImportSkillCollectionRequest.md b/docs/Model/ImportSkillCollectionRequest.md new file mode 100644 index 00000000..f7dd6d4d --- /dev/null +++ b/docs/Model/ImportSkillCollectionRequest.md @@ -0,0 +1,12 @@ +# # ImportSkillCollectionRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**namespace** | **string** | | +**source** | [**\QuantClient\Model\ImportSkillCollectionRequestSource**](ImportSkillCollectionRequestSource.md) | | +**tags** | **string[]** | | [optional] +**installed_by** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ImportSkillCollectionRequestSource.md b/docs/Model/ImportSkillCollectionRequestSource.md new file mode 100644 index 00000000..05b47b05 --- /dev/null +++ b/docs/Model/ImportSkillCollectionRequestSource.md @@ -0,0 +1,12 @@ +# # ImportSkillCollectionRequestSource + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | | +**repo** | **string** | | +**path** | **string** | | [optional] +**version** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ImportSkillRequest.md b/docs/Model/ImportSkillRequest.md new file mode 100644 index 00000000..bbc6b6e5 --- /dev/null +++ b/docs/Model/ImportSkillRequest.md @@ -0,0 +1,17 @@ +# # ImportSkillRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source** | [**\QuantClient\Model\ImportSkillRequestSource**](ImportSkillRequestSource.md) | | +**name** | **string** | | [optional] +**description** | **string** | | [optional] +**tags** | **string[]** | | [optional] +**trigger_condition** | **string** | | [optional] +**required_tools** | **string[]** | | [optional] +**disable_model_invocation** | **bool** | | [optional] +**allowed_tools** | **string[]** | | [optional] +**installed_by** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ImportSkillRequestSource.md b/docs/Model/ImportSkillRequestSource.md new file mode 100644 index 00000000..bb9f0dc5 --- /dev/null +++ b/docs/Model/ImportSkillRequestSource.md @@ -0,0 +1,13 @@ +# # ImportSkillRequestSource + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | | +**url** | **string** | | [optional] +**repo** | **string** | | [optional] +**path** | **string** | | [optional] +**version** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/KVLinkToProject200Response.md b/docs/Model/KVLinkToProject200Response.md new file mode 100644 index 00000000..b4effc50 --- /dev/null +++ b/docs/Model/KVLinkToProject200Response.md @@ -0,0 +1,10 @@ +# # KVLinkToProject200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/KVLinkToProjectRequest.md b/docs/Model/KVLinkToProjectRequest.md new file mode 100644 index 00000000..45b1ccc8 --- /dev/null +++ b/docs/Model/KVLinkToProjectRequest.md @@ -0,0 +1,9 @@ +# # KVLinkToProjectRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**project_id** | **int** | Target project ID to link to | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListAIAgents200ResponseAgentsInner.md b/docs/Model/ListAIAgents200ResponseAgentsInner.md index ef259a41..299cbaa9 100644 --- a/docs/Model/ListAIAgents200ResponseAgentsInner.md +++ b/docs/Model/ListAIAgents200ResponseAgentsInner.md @@ -12,6 +12,11 @@ Name | Type | Description | Notes **temperature** | **float** | | [optional] **max_tokens** | **int** | | [optional] **allowed_tools** | **string[]** | | [optional] +**assigned_skills** | **string[]** | | [optional] +**long_context** | **bool** | | [optional] +**guardrail_preset** | **string** | | [optional] +**is_global** | **bool** | | [optional] +**has_overlay** | **bool** | | [optional] **created_at** | **\DateTime** | | [optional] **updated_at** | **\DateTime** | | [optional] diff --git a/docs/Model/ListCustomTools200ResponseToolsInner.md b/docs/Model/ListCustomTools200ResponseToolsInner.md index 7f18d0fd..5651134d 100644 --- a/docs/Model/ListCustomTools200ResponseToolsInner.md +++ b/docs/Model/ListCustomTools200ResponseToolsInner.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **description** | **string** | | [optional] **edge_function_url** | **string** | | [optional] **is_async** | **bool** | | [optional] -**input_schema** | **object** | | [optional] +**input_schema** | **string** | | [optional] **created_at** | **\DateTime** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListOrchestrationBatches200Response.md b/docs/Model/ListOrchestrationBatches200Response.md new file mode 100644 index 00000000..4cd80259 --- /dev/null +++ b/docs/Model/ListOrchestrationBatches200Response.md @@ -0,0 +1,10 @@ +# # ListOrchestrationBatches200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**batches** | [**\QuantClient\Model\ListOrchestrationBatches200ResponseBatchesInner[]**](ListOrchestrationBatches200ResponseBatchesInner.md) | | [optional] +**next_cursor** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListOrchestrationBatches200ResponseBatchesInner.md b/docs/Model/ListOrchestrationBatches200ResponseBatchesInner.md new file mode 100644 index 00000000..3fa8cc71 --- /dev/null +++ b/docs/Model/ListOrchestrationBatches200ResponseBatchesInner.md @@ -0,0 +1,18 @@ +# # ListOrchestrationBatches200ResponseBatchesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**batch_id** | **string** | | [optional] +**orchestration_id** | **string** | | [optional] +**iteration** | **int** | | [optional] +**item_count** | **int** | | [optional] +**completed_count** | **int** | | [optional] +**failed_count** | **int** | | [optional] +**status** | **string** | | [optional] +**started_at** | **\DateTime** | | [optional] +**completed_at** | **\DateTime** | | [optional] +**error** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListOrchestrations200Response.md b/docs/Model/ListOrchestrations200Response.md new file mode 100644 index 00000000..496815d3 --- /dev/null +++ b/docs/Model/ListOrchestrations200Response.md @@ -0,0 +1,10 @@ +# # ListOrchestrations200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**orchestrations** | **object[]** | | [optional] +**next_cursor** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListSkillCollections200Response.md b/docs/Model/ListSkillCollections200Response.md new file mode 100644 index 00000000..f4586b6b --- /dev/null +++ b/docs/Model/ListSkillCollections200Response.md @@ -0,0 +1,9 @@ +# # ListSkillCollections200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collections** | [**\QuantClient\Model\ListSkillCollections200ResponseCollectionsInner[]**](ListSkillCollections200ResponseCollectionsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListSkillCollections200ResponseCollectionsInner.md b/docs/Model/ListSkillCollections200ResponseCollectionsInner.md new file mode 100644 index 00000000..a9fe66fc --- /dev/null +++ b/docs/Model/ListSkillCollections200ResponseCollectionsInner.md @@ -0,0 +1,11 @@ +# # ListSkillCollections200ResponseCollectionsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**namespace** | **string** | | [optional] +**count** | **int** | | [optional] +**skills** | **string[]** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListSkills200Response.md b/docs/Model/ListSkills200Response.md new file mode 100644 index 00000000..44cd28b0 --- /dev/null +++ b/docs/Model/ListSkills200Response.md @@ -0,0 +1,10 @@ +# # ListSkills200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**skills** | [**\QuantClient\Model\ListSkills200ResponseSkillsInner[]**](ListSkills200ResponseSkillsInner.md) | | [optional] +**count** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListSkills200ResponseSkillsInner.md b/docs/Model/ListSkills200ResponseSkillsInner.md new file mode 100644 index 00000000..d2739631 --- /dev/null +++ b/docs/Model/ListSkills200ResponseSkillsInner.md @@ -0,0 +1,17 @@ +# # ListSkills200ResponseSkillsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**skill_id** | **string** | | [optional] +**name** | **string** | | [optional] +**description** | **string** | | [optional] +**tags** | **string[]** | | [optional] +**source** | **object** | | [optional] +**trigger_condition** | **string** | | [optional] +**namespace** | **string** | | [optional] +**installed_at** | **\DateTime** | | [optional] +**updated_at** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListSlackBots200Response.md b/docs/Model/ListSlackBots200Response.md new file mode 100644 index 00000000..4699ce20 --- /dev/null +++ b/docs/Model/ListSlackBots200Response.md @@ -0,0 +1,9 @@ +# # ListSlackBots200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bots** | [**\QuantClient\Model\ListSlackBots200ResponseBotsInner[]**](ListSlackBots200ResponseBotsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListSlackBots200ResponseBotsInner.md b/docs/Model/ListSlackBots200ResponseBotsInner.md new file mode 100644 index 00000000..c1efb3c1 --- /dev/null +++ b/docs/Model/ListSlackBots200ResponseBotsInner.md @@ -0,0 +1,27 @@ +# # ListSlackBots200ResponseBotsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bot_id** | **string** | | [optional] +**name** | **string** | | [optional] +**setup_type** | **string** | | [optional] +**status** | **string** | | [optional] +**connected** | **bool** | | [optional] +**system_prompt** | **string** | | [optional] +**model_id** | **string** | | [optional] +**temperature** | **float** | | [optional] +**max_tokens** | **int** | | [optional] +**allowed_tools** | **string[]** | | [optional] +**assigned_skills** | **string[]** | | [optional] +**allowed_collections** | **string[]** | | [optional] +**allowed_sub_agents** | **string[]** | | [optional] +**guardrail_preset** | **string** | | [optional] +**filter_policies** | **string[]** | | [optional] +**long_context** | **bool** | | [optional] +**session_ttl_days** | **int** | | [optional] +**keywords_enabled** | **bool** | | [optional] +**created_at** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OaiChatCompletions200Response.md b/docs/Model/OaiChatCompletions200Response.md new file mode 100644 index 00000000..54049de6 --- /dev/null +++ b/docs/Model/OaiChatCompletions200Response.md @@ -0,0 +1,14 @@ +# # OaiChatCompletions200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**object** | **string** | | [optional] +**created** | **int** | | [optional] +**model** | **string** | | [optional] +**choices** | [**\QuantClient\Model\OaiChatCompletions200ResponseChoicesInner[]**](OaiChatCompletions200ResponseChoicesInner.md) | | [optional] +**usage** | [**\QuantClient\Model\OaiChatCompletions200ResponseUsage**](OaiChatCompletions200ResponseUsage.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OaiChatCompletions200ResponseChoicesInner.md b/docs/Model/OaiChatCompletions200ResponseChoicesInner.md new file mode 100644 index 00000000..da49159f --- /dev/null +++ b/docs/Model/OaiChatCompletions200ResponseChoicesInner.md @@ -0,0 +1,11 @@ +# # OaiChatCompletions200ResponseChoicesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index** | **int** | | [optional] +**message** | [**\QuantClient\Model\OaiChatCompletions200ResponseChoicesInnerMessage**](OaiChatCompletions200ResponseChoicesInnerMessage.md) | | [optional] +**finish_reason** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OaiChatCompletions200ResponseChoicesInnerMessage.md b/docs/Model/OaiChatCompletions200ResponseChoicesInnerMessage.md new file mode 100644 index 00000000..0313285d --- /dev/null +++ b/docs/Model/OaiChatCompletions200ResponseChoicesInnerMessage.md @@ -0,0 +1,11 @@ +# # OaiChatCompletions200ResponseChoicesInnerMessage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role** | **string** | | [optional] +**content** | **string** | | [optional] +**tool_calls** | **object[]** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OaiChatCompletions200ResponseUsage.md b/docs/Model/OaiChatCompletions200ResponseUsage.md new file mode 100644 index 00000000..054c0435 --- /dev/null +++ b/docs/Model/OaiChatCompletions200ResponseUsage.md @@ -0,0 +1,11 @@ +# # OaiChatCompletions200ResponseUsage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prompt_tokens** | **int** | | [optional] +**completion_tokens** | **int** | | [optional] +**total_tokens** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OaiChatCompletionsRequest.md b/docs/Model/OaiChatCompletionsRequest.md new file mode 100644 index 00000000..729177f8 --- /dev/null +++ b/docs/Model/OaiChatCompletionsRequest.md @@ -0,0 +1,17 @@ +# # OaiChatCompletionsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**model** | **string** | A model id from GET /oai/v1/models | +**messages** | [**\QuantClient\Model\OaiChatCompletionsRequestMessagesInner[]**](OaiChatCompletionsRequestMessagesInner.md) | | +**stream** | **bool** | Stream the response as SSE chat.completion.chunk events | [optional] [default to false] +**max_tokens** | **int** | | [optional] +**temperature** | **float** | | [optional] +**top_p** | **float** | | [optional] +**tools** | **object[]** | OpenAI function tool definitions | [optional] +**tool_choice** | **mixed** | auto | none | required | {type:function, function:{name}} | [optional] +**stream_options** | **object** | {include_usage: true} to emit a final usage chunk when streaming | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OaiChatCompletionsRequestMessagesInner.md b/docs/Model/OaiChatCompletionsRequestMessagesInner.md new file mode 100644 index 00000000..0bbfe311 --- /dev/null +++ b/docs/Model/OaiChatCompletionsRequestMessagesInner.md @@ -0,0 +1,10 @@ +# # OaiChatCompletionsRequestMessagesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role** | **string** | | [optional] +**content** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OaiEmbeddings200Response.md b/docs/Model/OaiEmbeddings200Response.md new file mode 100644 index 00000000..944d35fa --- /dev/null +++ b/docs/Model/OaiEmbeddings200Response.md @@ -0,0 +1,12 @@ +# # OaiEmbeddings200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | **string** | | [optional] +**data** | [**\QuantClient\Model\OaiEmbeddings200ResponseDataInner[]**](OaiEmbeddings200ResponseDataInner.md) | | [optional] +**model** | **string** | | [optional] +**usage** | [**\QuantClient\Model\OaiEmbeddings200ResponseUsage**](OaiEmbeddings200ResponseUsage.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OaiEmbeddings200ResponseDataInner.md b/docs/Model/OaiEmbeddings200ResponseDataInner.md new file mode 100644 index 00000000..8ec7ca0f --- /dev/null +++ b/docs/Model/OaiEmbeddings200ResponseDataInner.md @@ -0,0 +1,11 @@ +# # OaiEmbeddings200ResponseDataInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | **string** | | [optional] +**index** | **int** | | [optional] +**embedding** | **float[]** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OaiEmbeddings200ResponseUsage.md b/docs/Model/OaiEmbeddings200ResponseUsage.md new file mode 100644 index 00000000..e396df34 --- /dev/null +++ b/docs/Model/OaiEmbeddings200ResponseUsage.md @@ -0,0 +1,10 @@ +# # OaiEmbeddings200ResponseUsage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prompt_tokens** | **int** | | [optional] +**total_tokens** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OaiEmbeddingsRequest.md b/docs/Model/OaiEmbeddingsRequest.md new file mode 100644 index 00000000..f6d4518d --- /dev/null +++ b/docs/Model/OaiEmbeddingsRequest.md @@ -0,0 +1,10 @@ +# # OaiEmbeddingsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**model** | **string** | | +**input** | **mixed** | A string or array of strings to embed | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OaiGetModel200Response.md b/docs/Model/OaiGetModel200Response.md new file mode 100644 index 00000000..45942555 --- /dev/null +++ b/docs/Model/OaiGetModel200Response.md @@ -0,0 +1,12 @@ +# # OaiGetModel200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**object** | **string** | | [optional] +**created** | **int** | | [optional] +**owned_by** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OaiListModels200Response.md b/docs/Model/OaiListModels200Response.md new file mode 100644 index 00000000..532b0439 --- /dev/null +++ b/docs/Model/OaiListModels200Response.md @@ -0,0 +1,10 @@ +# # OaiListModels200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | **string** | | [optional] +**data** | [**\QuantClient\Model\OaiListModels200ResponseDataInner[]**](OaiListModels200ResponseDataInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OaiListModels200ResponseDataInner.md b/docs/Model/OaiListModels200ResponseDataInner.md new file mode 100644 index 00000000..d13bdf5e --- /dev/null +++ b/docs/Model/OaiListModels200ResponseDataInner.md @@ -0,0 +1,12 @@ +# # OaiListModels200ResponseDataInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**object** | **string** | | [optional] +**created** | **int** | | [optional] +**owned_by** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PatchEnvironmentComposeRequest.md b/docs/Model/PatchEnvironmentComposeRequest.md index 87021c2a..478d3064 100644 --- a/docs/Model/PatchEnvironmentComposeRequest.md +++ b/docs/Model/PatchEnvironmentComposeRequest.md @@ -9,6 +9,8 @@ Name | Type | Description | Notes **task_memory** | **string** | | [optional] **min_capacity** | **int** | | [optional] **max_capacity** | **int** | | [optional] +**single_task_only** | **bool** | Forces single-task mode (max one running task). Omitted = auto-detect from stateful containers. | [optional] +**startup_grace_period_seconds** | **int** | Seconds the load balancer waits after a task starts before an unhealthy health check can replace it. Default 120. | [optional] **containers** | **object[]** | | [optional] **spot_configuration** | [**\QuantClient\Model\PatchEnvironmentComposeRequestSpotConfiguration**](PatchEnvironmentComposeRequestSpotConfiguration.md) | | [optional] **enable_cross_env_networking** | **bool** | | [optional] diff --git a/docs/Model/RestoreDatabase202Response.md b/docs/Model/RestoreDatabase202Response.md new file mode 100644 index 00000000..17c61b58 --- /dev/null +++ b/docs/Model/RestoreDatabase202Response.md @@ -0,0 +1,11 @@ +# # RestoreDatabase202Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**restore_id** | **string** | | [optional] +**status** | **string** | | [optional] +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RestoreDatabaseRequest.md b/docs/Model/RestoreDatabaseRequest.md new file mode 100644 index 00000000..3e221e9d --- /dev/null +++ b/docs/Model/RestoreDatabaseRequest.md @@ -0,0 +1,10 @@ +# # RestoreDatabaseRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**backup_id** | **string** | The backup ID to restore (must match path param) | +**acknowledge_dataloss** | **bool** | Must be true to confirm existing data will be overwritten | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RestoreFilesystem202Response.md b/docs/Model/RestoreFilesystem202Response.md new file mode 100644 index 00000000..5cea5170 --- /dev/null +++ b/docs/Model/RestoreFilesystem202Response.md @@ -0,0 +1,11 @@ +# # RestoreFilesystem202Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**restore_id** | **string** | | [optional] +**status** | **string** | | [optional] +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RestoreFilesystemRequest.md b/docs/Model/RestoreFilesystemRequest.md new file mode 100644 index 00000000..4bc13f02 --- /dev/null +++ b/docs/Model/RestoreFilesystemRequest.md @@ -0,0 +1,10 @@ +# # RestoreFilesystemRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**backup_id** | **string** | The backup ID to restore (must match path param) | +**acknowledge_dataloss** | **bool** | Must be true. tar extraction overwrites same-named files in the target EFS in place; pre-existing files not in the archive are preserved. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ScalingPolicyListResponse.md b/docs/Model/ScalingPolicyListResponse.md new file mode 100644 index 00000000..7080b9c5 --- /dev/null +++ b/docs/Model/ScalingPolicyListResponse.md @@ -0,0 +1,9 @@ +# # ScalingPolicyListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**policies** | [**\QuantClient\Model\GetScalingPolicyResponse[]**](GetScalingPolicyResponse.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SearchSlackWorkspaceChannels200Response.md b/docs/Model/SearchSlackWorkspaceChannels200Response.md new file mode 100644 index 00000000..e8a5ac75 --- /dev/null +++ b/docs/Model/SearchSlackWorkspaceChannels200Response.md @@ -0,0 +1,9 @@ +# # SearchSlackWorkspaceChannels200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\QuantClient\Model\SearchSlackWorkspaceChannels200ResponseResultsInner[]**](SearchSlackWorkspaceChannels200ResponseResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SearchSlackWorkspaceChannels200ResponseResultsInner.md b/docs/Model/SearchSlackWorkspaceChannels200ResponseResultsInner.md new file mode 100644 index 00000000..ae66d577 --- /dev/null +++ b/docs/Model/SearchSlackWorkspaceChannels200ResponseResultsInner.md @@ -0,0 +1,10 @@ +# # SearchSlackWorkspaceChannels200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SearchSlackWorkspaceUsers200Response.md b/docs/Model/SearchSlackWorkspaceUsers200Response.md new file mode 100644 index 00000000..7f2504c2 --- /dev/null +++ b/docs/Model/SearchSlackWorkspaceUsers200Response.md @@ -0,0 +1,9 @@ +# # SearchSlackWorkspaceUsers200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\QuantClient\Model\SearchSlackWorkspaceUsers200ResponseResultsInner[]**](SearchSlackWorkspaceUsers200ResponseResultsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SearchSlackWorkspaceUsers200ResponseResultsInner.md b/docs/Model/SearchSlackWorkspaceUsers200ResponseResultsInner.md new file mode 100644 index 00000000..14f91225 --- /dev/null +++ b/docs/Model/SearchSlackWorkspaceUsers200ResponseResultsInner.md @@ -0,0 +1,11 @@ +# # SearchSlackWorkspaceUsers200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**name** | **string** | | [optional] +**real_name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SetScalingPolicyRequest.md b/docs/Model/SetScalingPolicyRequest.md new file mode 100644 index 00000000..0464a3db --- /dev/null +++ b/docs/Model/SetScalingPolicyRequest.md @@ -0,0 +1,12 @@ +# # SetScalingPolicyRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metric** | **string** | Metric to track for scaling. | +**target_value** | **float** | Target value. Percentage for CPU/Memory; req/sec per task for RPS. | +**scale_in_cooldown_seconds** | **int** | Cooldown (seconds) before another scale-in can start. | [optional] [default to 300] +**scale_out_cooldown_seconds** | **int** | Cooldown (seconds) before another scale-out can start. | [optional] [default to 60] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SyncSkillCollection200Response.md b/docs/Model/SyncSkillCollection200Response.md new file mode 100644 index 00000000..44152047 --- /dev/null +++ b/docs/Model/SyncSkillCollection200Response.md @@ -0,0 +1,14 @@ +# # SyncSkillCollection200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**namespace** | **string** | | [optional] +**synced** | **int** | | [optional] +**created** | **int** | | [optional] +**failed** | **int** | | [optional] +**removed_from_source** | **string[]** | | [optional] +**skills** | **object[]** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TokensCreate201Response.md b/docs/Model/TokensCreate201Response.md new file mode 100644 index 00000000..00b877f4 --- /dev/null +++ b/docs/Model/TokensCreate201Response.md @@ -0,0 +1,16 @@ +# # TokensCreate201Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token** | **string** | The plain text token (shown once) | [optional] +**id** | **int** | Token ID | [optional] +**name** | **string** | | [optional] +**scopes** | **string[]** | | [optional] +**projects** | **int[]** | | [optional] +**preset** | **string** | | [optional] +**expires_at** | **\DateTime** | | [optional] +**created_at** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TokensCreateRequest.md b/docs/Model/TokensCreateRequest.md new file mode 100644 index 00000000..f40b7ebf --- /dev/null +++ b/docs/Model/TokensCreateRequest.md @@ -0,0 +1,13 @@ +# # TokensCreateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Name for the token | +**preset** | **string** | Preset scope bundle | [optional] +**scopes** | **string[]** | Individual scopes (mutually exclusive with preset) | [optional] +**projects** | **int[]** | Project IDs to restrict this token to | [optional] +**expires_in** | **string** | Token expiration period | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TokensDelete200Response.md b/docs/Model/TokensDelete200Response.md new file mode 100644 index 00000000..0d2a4fb2 --- /dev/null +++ b/docs/Model/TokensDelete200Response.md @@ -0,0 +1,9 @@ +# # TokensDelete200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TokensList200ResponseInner.md b/docs/Model/TokensList200ResponseInner.md new file mode 100644 index 00000000..965cfa1c --- /dev/null +++ b/docs/Model/TokensList200ResponseInner.md @@ -0,0 +1,12 @@ +# # TokensList200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **string** | | [optional] +**last_used** | **\DateTime** | | [optional] +**created_at** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateAIAgentRequest.md b/docs/Model/UpdateAIAgentRequest.md index 3aac71ca..61cfcdd2 100644 --- a/docs/Model/UpdateAIAgentRequest.md +++ b/docs/Model/UpdateAIAgentRequest.md @@ -13,5 +13,9 @@ Name | Type | Description | Notes **max_tokens** | **int** | | [optional] **allowed_tools** | **string[]** | | [optional] **allowed_collections** | **string[]** | | [optional] +**assigned_skills** | **string[]** | Skill IDs to assign to this agent | [optional] +**long_context** | **bool** | Enable 1M context window support | [optional] +**guardrail_preset** | **string** | Guardrail preset name | [optional] +**filter_policies** | **string[]** | Filter policy IDs to apply to this agent's inference requests | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateFilterPolicyRequest.md b/docs/Model/UpdateFilterPolicyRequest.md new file mode 100644 index 00000000..fd20ac50 --- /dev/null +++ b/docs/Model/UpdateFilterPolicyRequest.md @@ -0,0 +1,12 @@ +# # UpdateFilterPolicyRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**description** | **string** | | [optional] +**enabled** | **bool** | | [optional] +**rules** | [**\QuantClient\Model\CreateFilterPolicyRequestRulesInner[]**](CreateFilterPolicyRequestRulesInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateGovernanceConfig200Response.md b/docs/Model/UpdateGovernanceConfig200Response.md new file mode 100644 index 00000000..7dfad080 --- /dev/null +++ b/docs/Model/UpdateGovernanceConfig200Response.md @@ -0,0 +1,10 @@ +# # UpdateGovernanceConfig200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**config** | **object** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateGovernanceConfigRequest.md b/docs/Model/UpdateGovernanceConfigRequest.md new file mode 100644 index 00000000..f9a16f73 --- /dev/null +++ b/docs/Model/UpdateGovernanceConfigRequest.md @@ -0,0 +1,15 @@ +# # UpdateGovernanceConfigRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ai_enabled** | **bool** | | +**model_policy** | **string** | | +**model_list** | **string[]** | | [optional] +**mandatory_guardrail_preset** | **string** | | [optional] +**mandatory_filter_policies** | **string[]** | | [optional] +**spend_limits** | [**\QuantClient\Model\GetGovernanceConfig200ResponseSpendLimits**](GetGovernanceConfig200ResponseSpendLimits.md) | | [optional] +**version** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateSkill200Response.md b/docs/Model/UpdateSkill200Response.md new file mode 100644 index 00000000..1f5b51f1 --- /dev/null +++ b/docs/Model/UpdateSkill200Response.md @@ -0,0 +1,11 @@ +# # UpdateSkill200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**skill** | **object** | | [optional] +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateSkillRequest.md b/docs/Model/UpdateSkillRequest.md new file mode 100644 index 00000000..d9a5038e --- /dev/null +++ b/docs/Model/UpdateSkillRequest.md @@ -0,0 +1,19 @@ +# # UpdateSkillRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**description** | **string** | | [optional] +**content** | **string** | | [optional] +**trigger_condition** | **string** | | [optional] +**tags** | **string[]** | | [optional] +**required_tools** | **string[]** | | [optional] +**source** | **object** | | [optional] +**files** | **object** | | [optional] +**disable_model_invocation** | **bool** | | [optional] +**allowed_tools** | **string[]** | | [optional] +**namespace** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateSlackBotRequest.md b/docs/Model/UpdateSlackBotRequest.md new file mode 100644 index 00000000..7edfc87a --- /dev/null +++ b/docs/Model/UpdateSlackBotRequest.md @@ -0,0 +1,30 @@ +# # UpdateSlackBotRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Display name for the bot | [optional] +**status** | **string** | Enable or disable the bot | [optional] +**system_prompt** | **string** | System prompt for the backing AI agent | [optional] +**model_id** | **string** | AI model identifier | [optional] +**temperature** | **float** | Sampling temperature | [optional] +**max_tokens** | **int** | Maximum response tokens | [optional] +**allowed_tools** | **string[]** | Tools the agent may use | [optional] +**assigned_skills** | **string[]** | Skills assigned to the agent | [optional] +**allowed_collections** | **string[]** | Vector DB collections the agent may query | [optional] +**allowed_sub_agents** | **string[]** | Sub-agents the agent may call | [optional] +**guardrail_preset** | **string** | Guardrail preset name | [optional] +**filter_policies** | **string[]** | Content filter policies | [optional] +**long_context** | **bool** | Enable long context mode | [optional] +**session_ttl_days** | **int** | Session TTL in days | [optional] +**allowed_channels** | **string[]** | Slack channel IDs the bot may respond in | [optional] +**allowed_users** | **string[]** | Slack user IDs allowed to interact with the bot | [optional] +**denied_users** | **string[]** | Slack user IDs denied from interacting with the bot | [optional] +**allow_guests** | **bool** | Whether guest users may interact with the bot | [optional] +**home_tab_content** | **string** | Content shown on the bot's Home tab in Slack | [optional] +**agent_access_control** | **object** | Agent-level access control settings | [optional] +**keywords_enabled** | **bool** | Whether keyword triggers are enabled | [optional] +**keywords** | **string[]** | Keywords that trigger the bot | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UploadVectorDocumentsRequestDocumentsInner.md b/docs/Model/UploadVectorDocumentsRequestDocumentsInner.md index 4751af31..f5d5cff5 100644 --- a/docs/Model/UploadVectorDocumentsRequestDocumentsInner.md +++ b/docs/Model/UploadVectorDocumentsRequestDocumentsInner.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **content** | **string** | Document text content | +**key** | **string** | Stable document key for upsert | [optional] **metadata** | [**\QuantClient\Model\UploadVectorDocumentsRequestDocumentsInnerMetadata**](UploadVectorDocumentsRequestDocumentsInnerMetadata.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpsertAgentOverlay200Response.md b/docs/Model/UpsertAgentOverlay200Response.md new file mode 100644 index 00000000..86129cda --- /dev/null +++ b/docs/Model/UpsertAgentOverlay200Response.md @@ -0,0 +1,9 @@ +# # UpsertAgentOverlay200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**overlay** | **object** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpsertAgentOverlayRequest.md b/docs/Model/UpsertAgentOverlayRequest.md new file mode 100644 index 00000000..9411790e --- /dev/null +++ b/docs/Model/UpsertAgentOverlayRequest.md @@ -0,0 +1,19 @@ +# # UpsertAgentOverlayRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**model_id** | **string** | Override the base agent's model | [optional] +**temperature** | **float** | Override temperature | [optional] +**max_tokens** | **int** | Override max tokens | [optional] +**disabled_skills** | **string[]** | Global skill IDs to exclude | [optional] +**additional_skills** | **string[]** | Org-owned skill IDs to add | [optional] +**additional_tools** | **string[]** | Tool names to add | [optional] +**disabled_tools** | **string[]** | Tool names to remove | [optional] +**system_prompt_append** | **string** | Text appended to base system prompt | [optional] +**allowed_collections** | **string[]** | Vector DB collections | [optional] +**guardrail_preset** | **string** | Guardrail preset | [optional] +**version** | **int** | Current version for optimistic concurrency | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2CrawlerSchedule.md b/docs/Model/V2CrawlerSchedule.md index 13bf0418..4eb59fe6 100644 --- a/docs/Model/V2CrawlerSchedule.md +++ b/docs/Model/V2CrawlerSchedule.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **crawler_uuid** | **string** | Crawler UUID | [optional] **project_id** | **int** | Project ID | **crawler_last_run_id** | **int** | Last run ID | -**schedule_cron_string** | **string** | Cron schedule string | +**schedule_cron_string** | **string** | Standard Unix cron expression with 5 space-separated fields: minute, hour, day-of-month, month, day-of-week. Example: 0 2 * * * runs daily at 2 AM. | **created_at** | **\DateTime** | Creation timestamp | [optional] **updated_at** | **\DateTime** | Last update timestamp | [optional] diff --git a/docs/Model/V2CrawlerScheduleRequest.md b/docs/Model/V2CrawlerScheduleRequest.md index 1edc1a5d..2a8971a0 100644 --- a/docs/Model/V2CrawlerScheduleRequest.md +++ b/docs/Model/V2CrawlerScheduleRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | Schedule name | -**schedule_cron_string** | **string** | Cron schedule string | +**name** | **string** | Schedule name. If not provided, defaults to 'Schedule {crawler_name}'. | [optional] +**schedule_cron_string** | **string** | Standard Unix cron expression with 5 space-separated fields: minute, hour, day-of-month, month, day-of-week. Example: 0 2 * * * for daily at 2 AM. | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2MetricData.md b/docs/Model/V2MetricData.md new file mode 100644 index 00000000..692332d5 --- /dev/null +++ b/docs/Model/V2MetricData.md @@ -0,0 +1,12 @@ +# # V2MetricData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**series** | [**\QuantClient\Model\V2MetricDataPoint[]**](V2MetricDataPoint.md) | Time series data points | +**period_total** | **float** | Total value for the period | +**all_time_total** | **float** | All-time total value | +**period_average** | **float** | Average value per time unit in the period | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2MetricDataPoint.md b/docs/Model/V2MetricDataPoint.md new file mode 100644 index 00000000..c2d70ad1 --- /dev/null +++ b/docs/Model/V2MetricDataPoint.md @@ -0,0 +1,10 @@ +# # V2MetricDataPoint + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | [**\QuantClient\Model\V2MetricDataPointTimestamp**](V2MetricDataPointTimestamp.md) | | +**value** | **float** | Metric value at this timestamp | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2MetricDataPointTimestamp.md b/docs/Model/V2MetricDataPointTimestamp.md new file mode 100644 index 00000000..8f0b225f --- /dev/null +++ b/docs/Model/V2MetricDataPointTimestamp.md @@ -0,0 +1,8 @@ +# # V2MetricDataPointTimestamp + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2MetricsMeta.md b/docs/Model/V2MetricsMeta.md new file mode 100644 index 00000000..57b82261 --- /dev/null +++ b/docs/Model/V2MetricsMeta.md @@ -0,0 +1,14 @@ +# # V2MetricsMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**period** | **string** | The period type for this data | +**granularity** | **string** | The granularity of data points | +**start_time** | **string** | Start time of the data range (ISO8601 or Unix timestamp based on timestamp_format parameter) | +**end_time** | **string** | End time of the data range (ISO8601 or Unix timestamp based on timestamp_format parameter) | +**metrics** | **string[]** | List of metrics included in the response | +**domain** | **string** | Domain filter applied (if any) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2MetricsResponse.md b/docs/Model/V2MetricsResponse.md new file mode 100644 index 00000000..744a99a5 --- /dev/null +++ b/docs/Model/V2MetricsResponse.md @@ -0,0 +1,10 @@ +# # V2MetricsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**meta** | [**\QuantClient\Model\V2MetricsMeta**](V2MetricsMeta.md) | | +**data** | [**array**](V2MetricData.md) | Metrics data keyed by metric name | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2Rule.md b/docs/Model/V2Rule.md index 821d6cac..d9615dbb 100644 --- a/docs/Model/V2Rule.md +++ b/docs/Model/V2Rule.md @@ -18,6 +18,9 @@ Name | Type | Description | Notes **ip** | **string** | IP address | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **country** | **string** | Country code | [optional] **country_is** | **string[]** | Allowed countries | [optional] **country_is_not** | **string[]** | Excluded countries | [optional] diff --git a/docs/Model/V2RuleAuth.md b/docs/Model/V2RuleAuth.md index 48075e0c..483d3349 100644 --- a/docs/Model/V2RuleAuth.md +++ b/docs/Model/V2RuleAuth.md @@ -18,6 +18,9 @@ Name | Type | Description | Notes **ip** | **string** | IP address | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **country** | **string** | Country code | [optional] **country_is** | **string[]** | Allowed countries | [optional] **country_is_not** | **string[]** | Excluded countries | [optional] diff --git a/docs/Model/V2RuleAuthRequest.md b/docs/Model/V2RuleAuthRequest.md index 929f9737..33298945 100644 --- a/docs/Model/V2RuleAuthRequest.md +++ b/docs/Model/V2RuleAuthRequest.md @@ -19,6 +19,9 @@ Name | Type | Description | Notes **ip** | **string** | IP filter type (ip_is, ip_is_not, any) | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **auth_user** | **string** | Authentication username | **auth_pass** | **string** | Authentication password | diff --git a/docs/Model/V2RuleBotChallenge.md b/docs/Model/V2RuleBotChallenge.md index 07d8ee7c..4faf5b15 100644 --- a/docs/Model/V2RuleBotChallenge.md +++ b/docs/Model/V2RuleBotChallenge.md @@ -18,6 +18,9 @@ Name | Type | Description | Notes **ip** | **string** | IP address | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **country** | **string** | Country code | [optional] **country_is** | **string[]** | Allowed countries | [optional] **country_is_not** | **string[]** | Excluded countries | [optional] diff --git a/docs/Model/V2RuleBotChallengeRequest.md b/docs/Model/V2RuleBotChallengeRequest.md index 41d6ee5a..6f6365d8 100644 --- a/docs/Model/V2RuleBotChallengeRequest.md +++ b/docs/Model/V2RuleBotChallengeRequest.md @@ -19,6 +19,9 @@ Name | Type | Description | Notes **ip** | **string** | IP filter type (ip_is, ip_is_not, any) | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **robot_challenge_type** | **string** | Challenge type (invisible or checkbox) | **robot_challenge_verification_ttl** | **int** | Verification TTL in seconds | [optional] [default to 10800] **robot_challenge_challenge_ttl** | **int** | Challenge TTL in seconds | [optional] [default to 30] diff --git a/docs/Model/V2RuleContentFilter.md b/docs/Model/V2RuleContentFilter.md index 7bca2dd6..49110b10 100644 --- a/docs/Model/V2RuleContentFilter.md +++ b/docs/Model/V2RuleContentFilter.md @@ -18,6 +18,9 @@ Name | Type | Description | Notes **ip** | **string** | IP address | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **country** | **string** | Country code | [optional] **country_is** | **string[]** | Allowed countries | [optional] **country_is_not** | **string[]** | Excluded countries | [optional] diff --git a/docs/Model/V2RuleContentFilterRequest.md b/docs/Model/V2RuleContentFilterRequest.md index 5bd65d48..0b96d8ce 100644 --- a/docs/Model/V2RuleContentFilterRequest.md +++ b/docs/Model/V2RuleContentFilterRequest.md @@ -19,6 +19,9 @@ Name | Type | Description | Notes **ip** | **string** | IP filter type (ip_is, ip_is_not, any) | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **fn_uuid** | **string** | Function UUID | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2RuleCustomResponse.md b/docs/Model/V2RuleCustomResponse.md index ea82d8bb..cde1c12c 100644 --- a/docs/Model/V2RuleCustomResponse.md +++ b/docs/Model/V2RuleCustomResponse.md @@ -18,6 +18,9 @@ Name | Type | Description | Notes **ip** | **string** | IP address | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **country** | **string** | Country code | [optional] **country_is** | **string[]** | Allowed countries | [optional] **country_is_not** | **string[]** | Excluded countries | [optional] diff --git a/docs/Model/V2RuleCustomResponseRequest.md b/docs/Model/V2RuleCustomResponseRequest.md index 902bc6da..b8931eb7 100644 --- a/docs/Model/V2RuleCustomResponseRequest.md +++ b/docs/Model/V2RuleCustomResponseRequest.md @@ -19,6 +19,9 @@ Name | Type | Description | Notes **ip** | **string** | IP filter type (ip_is, ip_is_not, any) | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **custom_response_body** | **string** | Custom response body content | **custom_response_status_code** | **int** | HTTP status code for custom response | [optional] [default to 200] **status_code** | **int** | Legacy field for status code (deprecated) | [optional] diff --git a/docs/Model/V2RuleFunction.md b/docs/Model/V2RuleFunction.md index e697926c..4f21957e 100644 --- a/docs/Model/V2RuleFunction.md +++ b/docs/Model/V2RuleFunction.md @@ -18,6 +18,9 @@ Name | Type | Description | Notes **ip** | **string** | IP address | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **country** | **string** | Country code | [optional] **country_is** | **string[]** | Allowed countries | [optional] **country_is_not** | **string[]** | Excluded countries | [optional] diff --git a/docs/Model/V2RuleFunctionRequest.md b/docs/Model/V2RuleFunctionRequest.md index 15e1f297..d6adcf77 100644 --- a/docs/Model/V2RuleFunctionRequest.md +++ b/docs/Model/V2RuleFunctionRequest.md @@ -19,6 +19,9 @@ Name | Type | Description | Notes **ip** | **string** | IP filter type (ip_is, ip_is_not, any) | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **fn_uuid** | **string** | Function UUID | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2RuleHeader.md b/docs/Model/V2RuleHeader.md index 8e5a7f9d..f0839fde 100644 --- a/docs/Model/V2RuleHeader.md +++ b/docs/Model/V2RuleHeader.md @@ -18,6 +18,9 @@ Name | Type | Description | Notes **ip** | **string** | IP address | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **country** | **string** | Country code | [optional] **country_is** | **string[]** | Allowed countries | [optional] **country_is_not** | **string[]** | Excluded countries | [optional] diff --git a/docs/Model/V2RuleHeaderRequest.md b/docs/Model/V2RuleHeaderRequest.md index 78c130ea..eda1a2c4 100644 --- a/docs/Model/V2RuleHeaderRequest.md +++ b/docs/Model/V2RuleHeaderRequest.md @@ -19,6 +19,9 @@ Name | Type | Description | Notes **ip** | **string** | IP filter type (ip_is, ip_is_not, any) | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **headers** | **array** | Headers to set | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2RuleProxy.md b/docs/Model/V2RuleProxy.md index 806d21ad..01e38e4d 100644 --- a/docs/Model/V2RuleProxy.md +++ b/docs/Model/V2RuleProxy.md @@ -18,6 +18,9 @@ Name | Type | Description | Notes **ip** | **string** | IP address | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **country** | **string** | Country code | [optional] **country_is** | **string[]** | Allowed countries | [optional] **country_is_not** | **string[]** | Excluded countries | [optional] diff --git a/docs/Model/V2RuleProxyRequest.md b/docs/Model/V2RuleProxyRequest.md index 59d567f8..98079341 100644 --- a/docs/Model/V2RuleProxyRequest.md +++ b/docs/Model/V2RuleProxyRequest.md @@ -19,6 +19,9 @@ Name | Type | Description | Notes **ip** | **string** | IP filter type (ip_is, ip_is_not, any) | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **to** | **string** | Target URL to proxy to | **host** | **string** | Host header override | [optional] **auth_user** | **string** | Basic auth username | [optional] [default to ''] diff --git a/docs/Model/V2RuleRedirect.md b/docs/Model/V2RuleRedirect.md index be36031d..cd68f8db 100644 --- a/docs/Model/V2RuleRedirect.md +++ b/docs/Model/V2RuleRedirect.md @@ -18,6 +18,9 @@ Name | Type | Description | Notes **ip** | **string** | IP address | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **country** | **string** | Country code | [optional] **country_is** | **string[]** | Allowed countries | [optional] **country_is_not** | **string[]** | Excluded countries | [optional] diff --git a/docs/Model/V2RuleRedirectRequest.md b/docs/Model/V2RuleRedirectRequest.md index 97210cb4..746b41f8 100644 --- a/docs/Model/V2RuleRedirectRequest.md +++ b/docs/Model/V2RuleRedirectRequest.md @@ -19,6 +19,9 @@ Name | Type | Description | Notes **ip** | **string** | IP filter type (ip_is, ip_is_not, any) | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **redirect_to** | **string** | Redirect destination URL | **redirect_code** | **string** | HTTP status code for redirect | [optional] [default to '301'] diff --git a/docs/Model/V2RuleRequest.md b/docs/Model/V2RuleRequest.md index 8d3cc052..4cedcc5a 100644 --- a/docs/Model/V2RuleRequest.md +++ b/docs/Model/V2RuleRequest.md @@ -19,5 +19,8 @@ Name | Type | Description | Notes **ip** | **string** | IP filter type (ip_is, ip_is_not, any) | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/V2RuleServeStatic.md b/docs/Model/V2RuleServeStatic.md index 6aff7c8d..ad821106 100644 --- a/docs/Model/V2RuleServeStatic.md +++ b/docs/Model/V2RuleServeStatic.md @@ -18,6 +18,9 @@ Name | Type | Description | Notes **ip** | **string** | IP address | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **country** | **string** | Country code | [optional] **country_is** | **string[]** | Allowed countries | [optional] **country_is_not** | **string[]** | Excluded countries | [optional] diff --git a/docs/Model/V2RuleServeStaticRequest.md b/docs/Model/V2RuleServeStaticRequest.md index 170267f0..f15fe686 100644 --- a/docs/Model/V2RuleServeStaticRequest.md +++ b/docs/Model/V2RuleServeStaticRequest.md @@ -19,6 +19,9 @@ Name | Type | Description | Notes **ip** | **string** | IP filter type (ip_is, ip_is_not, any) | [optional] **ip_is** | **string[]** | Allowed IP addresses | [optional] **ip_is_not** | **string[]** | Excluded IP addresses | [optional] +**asn** | **string** | ASN filter type (asn_is, asn_is_not, any) | [optional] +**asn_is** | **string[]** | Allowed AS numbers | [optional] +**asn_is_not** | **string[]** | Excluded AS numbers | [optional] **static_file_path** | **string** | Path to the static file to serve | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Api/AIAgentsApi.php b/src/Api/AIAgentsApi.php index c2dde72d..142f4cc6 100644 --- a/src/Api/AIAgentsApi.php +++ b/src/Api/AIAgentsApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -83,15 +83,24 @@ class AIAgentsApi 'deleteAIAgent' => [ 'application/json', ], + 'deleteAgentOverlay' => [ + 'application/json', + ], 'getAIAgent' => [ 'application/json', ], + 'getAgentOverlay' => [ + 'application/json', + ], 'listAIAgents' => [ 'application/json', ], 'updateAIAgent' => [ 'application/json', ], + 'upsertAgentOverlay' => [ + 'application/json', + ], ]; /** @@ -1049,40 +1058,40 @@ public function deleteAIAgentRequest($organisation, $agent_id, string $contentTy } /** - * Operation getAIAgent + * Operation deleteAgentOverlay * - * Get Agent Details + * Delete Agent Overlay * * @param string $organisation The organisation ID (required) - * @param string $agent_id The agent ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIAgent'] to see the possible values for this operation + * @param string $agent_id Global agent identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAgentOverlay'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \QuantClient\Model\GetAIAgent200Response + * @return \QuantClient\Model\DeleteAgentOverlay200Response */ - public function getAIAgent($organisation, $agent_id, string $contentType = self::contentTypes['getAIAgent'][0]) + public function deleteAgentOverlay($organisation, $agent_id, string $contentType = self::contentTypes['deleteAgentOverlay'][0]) { - list($response) = $this->getAIAgentWithHttpInfo($organisation, $agent_id, $contentType); + list($response) = $this->deleteAgentOverlayWithHttpInfo($organisation, $agent_id, $contentType); return $response; } /** - * Operation getAIAgentWithHttpInfo + * Operation deleteAgentOverlayWithHttpInfo * - * Get Agent Details + * Delete Agent Overlay * * @param string $organisation The organisation ID (required) - * @param string $agent_id The agent ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIAgent'] to see the possible values for this operation + * @param string $agent_id Global agent identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAgentOverlay'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \QuantClient\Model\GetAIAgent200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \QuantClient\Model\DeleteAgentOverlay200Response, HTTP status code, HTTP response headers (array of strings) */ - public function getAIAgentWithHttpInfo($organisation, $agent_id, string $contentType = self::contentTypes['getAIAgent'][0]) + public function deleteAgentOverlayWithHttpInfo($organisation, $agent_id, string $contentType = self::contentTypes['deleteAgentOverlay'][0]) { - $request = $this->getAIAgentRequest($organisation, $agent_id, $contentType); + $request = $this->deleteAgentOverlayRequest($organisation, $agent_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1110,7 +1119,7 @@ public function getAIAgentWithHttpInfo($organisation, $agent_id, string $content switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\QuantClient\Model\GetAIAgent200Response', + '\QuantClient\Model\DeleteAgentOverlay200Response', $request, $response, ); @@ -1132,7 +1141,7 @@ public function getAIAgentWithHttpInfo($organisation, $agent_id, string $content } return $this->handleResponseWithDataType( - '\QuantClient\Model\GetAIAgent200Response', + '\QuantClient\Model\DeleteAgentOverlay200Response', $request, $response, ); @@ -1141,7 +1150,7 @@ public function getAIAgentWithHttpInfo($organisation, $agent_id, string $content case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\QuantClient\Model\GetAIAgent200Response', + '\QuantClient\Model\DeleteAgentOverlay200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1154,20 +1163,20 @@ public function getAIAgentWithHttpInfo($organisation, $agent_id, string $content } /** - * Operation getAIAgentAsync + * Operation deleteAgentOverlayAsync * - * Get Agent Details + * Delete Agent Overlay * * @param string $organisation The organisation ID (required) - * @param string $agent_id The agent ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIAgent'] to see the possible values for this operation + * @param string $agent_id Global agent identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAgentOverlay'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAIAgentAsync($organisation, $agent_id, string $contentType = self::contentTypes['getAIAgent'][0]) + public function deleteAgentOverlayAsync($organisation, $agent_id, string $contentType = self::contentTypes['deleteAgentOverlay'][0]) { - return $this->getAIAgentAsyncWithHttpInfo($organisation, $agent_id, $contentType) + return $this->deleteAgentOverlayAsyncWithHttpInfo($organisation, $agent_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1176,21 +1185,21 @@ function ($response) { } /** - * Operation getAIAgentAsyncWithHttpInfo + * Operation deleteAgentOverlayAsyncWithHttpInfo * - * Get Agent Details + * Delete Agent Overlay * * @param string $organisation The organisation ID (required) - * @param string $agent_id The agent ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIAgent'] to see the possible values for this operation + * @param string $agent_id Global agent identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAgentOverlay'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAIAgentAsyncWithHttpInfo($organisation, $agent_id, string $contentType = self::contentTypes['getAIAgent'][0]) + public function deleteAgentOverlayAsyncWithHttpInfo($organisation, $agent_id, string $contentType = self::contentTypes['deleteAgentOverlay'][0]) { - $returnType = '\QuantClient\Model\GetAIAgent200Response'; - $request = $this->getAIAgentRequest($organisation, $agent_id, $contentType); + $returnType = '\QuantClient\Model\DeleteAgentOverlay200Response'; + $request = $this->deleteAgentOverlayRequest($organisation, $agent_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1229,34 +1238,34 @@ function ($exception) { } /** - * Create request for operation 'getAIAgent' + * Create request for operation 'deleteAgentOverlay' * * @param string $organisation The organisation ID (required) - * @param string $agent_id The agent ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIAgent'] to see the possible values for this operation + * @param string $agent_id Global agent identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteAgentOverlay'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getAIAgentRequest($organisation, $agent_id, string $contentType = self::contentTypes['getAIAgent'][0]) + public function deleteAgentOverlayRequest($organisation, $agent_id, string $contentType = self::contentTypes['deleteAgentOverlay'][0]) { // verify the required parameter 'organisation' is set if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $organisation when calling getAIAgent' + 'Missing the required parameter $organisation when calling deleteAgentOverlay' ); } // verify the required parameter 'agent_id' is set if ($agent_id === null || (is_array($agent_id) && count($agent_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $agent_id when calling getAIAgent' + 'Missing the required parameter $agent_id when calling deleteAgentOverlay' ); } - $resourcePath = '/api/v3/organizations/{organisation}/ai/agents/{agentId}'; + $resourcePath = '/api/v3/organizations/{organisation}/ai/agents/{agentId}/overlay'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1333,7 +1342,7 @@ public function getAIAgentRequest($organisation, $agent_id, string $contentType $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'DELETE', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1341,40 +1350,40 @@ public function getAIAgentRequest($organisation, $agent_id, string $contentType } /** - * Operation listAIAgents + * Operation getAIAgent * - * List AI Agents + * Get Agent Details * * @param string $organisation The organisation ID (required) - * @param string|null $group Optional group filter (e.g., 'development', 'compliance') (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAIAgents'] to see the possible values for this operation + * @param string $agent_id The agent ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIAgent'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \QuantClient\Model\ListAIAgents200Response + * @return \QuantClient\Model\GetAIAgent200Response */ - public function listAIAgents($organisation, $group = null, string $contentType = self::contentTypes['listAIAgents'][0]) + public function getAIAgent($organisation, $agent_id, string $contentType = self::contentTypes['getAIAgent'][0]) { - list($response) = $this->listAIAgentsWithHttpInfo($organisation, $group, $contentType); + list($response) = $this->getAIAgentWithHttpInfo($organisation, $agent_id, $contentType); return $response; } /** - * Operation listAIAgentsWithHttpInfo + * Operation getAIAgentWithHttpInfo * - * List AI Agents + * Get Agent Details * * @param string $organisation The organisation ID (required) - * @param string|null $group Optional group filter (e.g., 'development', 'compliance') (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAIAgents'] to see the possible values for this operation + * @param string $agent_id The agent ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIAgent'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \QuantClient\Model\ListAIAgents200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \QuantClient\Model\GetAIAgent200Response, HTTP status code, HTTP response headers (array of strings) */ - public function listAIAgentsWithHttpInfo($organisation, $group = null, string $contentType = self::contentTypes['listAIAgents'][0]) + public function getAIAgentWithHttpInfo($organisation, $agent_id, string $contentType = self::contentTypes['getAIAgent'][0]) { - $request = $this->listAIAgentsRequest($organisation, $group, $contentType); + $request = $this->getAIAgentRequest($organisation, $agent_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1402,7 +1411,7 @@ public function listAIAgentsWithHttpInfo($organisation, $group = null, string $c switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\QuantClient\Model\ListAIAgents200Response', + '\QuantClient\Model\GetAIAgent200Response', $request, $response, ); @@ -1424,7 +1433,7 @@ public function listAIAgentsWithHttpInfo($organisation, $group = null, string $c } return $this->handleResponseWithDataType( - '\QuantClient\Model\ListAIAgents200Response', + '\QuantClient\Model\GetAIAgent200Response', $request, $response, ); @@ -1433,7 +1442,7 @@ public function listAIAgentsWithHttpInfo($organisation, $group = null, string $c case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\QuantClient\Model\ListAIAgents200Response', + '\QuantClient\Model\GetAIAgent200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1446,20 +1455,20 @@ public function listAIAgentsWithHttpInfo($organisation, $group = null, string $c } /** - * Operation listAIAgentsAsync + * Operation getAIAgentAsync * - * List AI Agents + * Get Agent Details * * @param string $organisation The organisation ID (required) - * @param string|null $group Optional group filter (e.g., 'development', 'compliance') (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAIAgents'] to see the possible values for this operation + * @param string $agent_id The agent ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIAgent'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listAIAgentsAsync($organisation, $group = null, string $contentType = self::contentTypes['listAIAgents'][0]) + public function getAIAgentAsync($organisation, $agent_id, string $contentType = self::contentTypes['getAIAgent'][0]) { - return $this->listAIAgentsAsyncWithHttpInfo($organisation, $group, $contentType) + return $this->getAIAgentAsyncWithHttpInfo($organisation, $agent_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1468,21 +1477,21 @@ function ($response) { } /** - * Operation listAIAgentsAsyncWithHttpInfo + * Operation getAIAgentAsyncWithHttpInfo * - * List AI Agents + * Get Agent Details * * @param string $organisation The organisation ID (required) - * @param string|null $group Optional group filter (e.g., 'development', 'compliance') (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAIAgents'] to see the possible values for this operation + * @param string $agent_id The agent ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIAgent'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listAIAgentsAsyncWithHttpInfo($organisation, $group = null, string $contentType = self::contentTypes['listAIAgents'][0]) + public function getAIAgentAsyncWithHttpInfo($organisation, $agent_id, string $contentType = self::contentTypes['getAIAgent'][0]) { - $returnType = '\QuantClient\Model\ListAIAgents200Response'; - $request = $this->listAIAgentsRequest($organisation, $group, $contentType); + $returnType = '\QuantClient\Model\GetAIAgent200Response'; + $request = $this->getAIAgentRequest($organisation, $agent_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1521,43 +1530,40 @@ function ($exception) { } /** - * Create request for operation 'listAIAgents' + * Create request for operation 'getAIAgent' * * @param string $organisation The organisation ID (required) - * @param string|null $group Optional group filter (e.g., 'development', 'compliance') (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAIAgents'] to see the possible values for this operation + * @param string $agent_id The agent ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIAgent'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function listAIAgentsRequest($organisation, $group = null, string $contentType = self::contentTypes['listAIAgents'][0]) + public function getAIAgentRequest($organisation, $agent_id, string $contentType = self::contentTypes['getAIAgent'][0]) { // verify the required parameter 'organisation' is set if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $organisation when calling listAIAgents' + 'Missing the required parameter $organisation when calling getAIAgent' ); } + // verify the required parameter 'agent_id' is set + if ($agent_id === null || (is_array($agent_id) && count($agent_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $agent_id when calling getAIAgent' + ); + } - $resourcePath = '/api/v3/organizations/{organisation}/ai/agents'; + $resourcePath = '/api/v3/organizations/{organisation}/ai/agents/{agentId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $group, - 'group', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); // path params @@ -1568,6 +1574,14 @@ public function listAIAgentsRequest($organisation, $group = null, string $conten $resourcePath ); } + // path params + if ($agent_id !== null) { + $resourcePath = str_replace( + '{' . 'agentId' . '}', + ObjectSerializer::toPathValue($agent_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -1628,42 +1642,40 @@ public function listAIAgentsRequest($organisation, $group = null, string $conten } /** - * Operation updateAIAgent + * Operation getAgentOverlay * - * Update Agent + * Get Agent Overlay * * @param string $organisation The organisation ID (required) - * @param string $agent_id The agent ID (required) - * @param \QuantClient\Model\UpdateAIAgentRequest $update_ai_agent_request update_ai_agent_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAIAgent'] to see the possible values for this operation + * @param string $agent_id Global agent identifier (e.g., 'quantgov-code') (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAgentOverlay'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \QuantClient\Model\UpdateAIAgent200Response + * @return \QuantClient\Model\GetAgentOverlay200Response */ - public function updateAIAgent($organisation, $agent_id, $update_ai_agent_request, string $contentType = self::contentTypes['updateAIAgent'][0]) + public function getAgentOverlay($organisation, $agent_id, string $contentType = self::contentTypes['getAgentOverlay'][0]) { - list($response) = $this->updateAIAgentWithHttpInfo($organisation, $agent_id, $update_ai_agent_request, $contentType); + list($response) = $this->getAgentOverlayWithHttpInfo($organisation, $agent_id, $contentType); return $response; } /** - * Operation updateAIAgentWithHttpInfo + * Operation getAgentOverlayWithHttpInfo * - * Update Agent + * Get Agent Overlay * * @param string $organisation The organisation ID (required) - * @param string $agent_id The agent ID (required) - * @param \QuantClient\Model\UpdateAIAgentRequest $update_ai_agent_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAIAgent'] to see the possible values for this operation + * @param string $agent_id Global agent identifier (e.g., 'quantgov-code') (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAgentOverlay'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \QuantClient\Model\UpdateAIAgent200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \QuantClient\Model\GetAgentOverlay200Response, HTTP status code, HTTP response headers (array of strings) */ - public function updateAIAgentWithHttpInfo($organisation, $agent_id, $update_ai_agent_request, string $contentType = self::contentTypes['updateAIAgent'][0]) + public function getAgentOverlayWithHttpInfo($organisation, $agent_id, string $contentType = self::contentTypes['getAgentOverlay'][0]) { - $request = $this->updateAIAgentRequest($organisation, $agent_id, $update_ai_agent_request, $contentType); + $request = $this->getAgentOverlayRequest($organisation, $agent_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1691,7 +1703,7 @@ public function updateAIAgentWithHttpInfo($organisation, $agent_id, $update_ai_a switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\QuantClient\Model\UpdateAIAgent200Response', + '\QuantClient\Model\GetAgentOverlay200Response', $request, $response, ); @@ -1713,7 +1725,7 @@ public function updateAIAgentWithHttpInfo($organisation, $agent_id, $update_ai_a } return $this->handleResponseWithDataType( - '\QuantClient\Model\UpdateAIAgent200Response', + '\QuantClient\Model\GetAgentOverlay200Response', $request, $response, ); @@ -1722,7 +1734,7 @@ public function updateAIAgentWithHttpInfo($organisation, $agent_id, $update_ai_a case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\QuantClient\Model\UpdateAIAgent200Response', + '\QuantClient\Model\GetAgentOverlay200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1735,21 +1747,20 @@ public function updateAIAgentWithHttpInfo($organisation, $agent_id, $update_ai_a } /** - * Operation updateAIAgentAsync + * Operation getAgentOverlayAsync * - * Update Agent + * Get Agent Overlay * * @param string $organisation The organisation ID (required) - * @param string $agent_id The agent ID (required) - * @param \QuantClient\Model\UpdateAIAgentRequest $update_ai_agent_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAIAgent'] to see the possible values for this operation + * @param string $agent_id Global agent identifier (e.g., 'quantgov-code') (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAgentOverlay'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAIAgentAsync($organisation, $agent_id, $update_ai_agent_request, string $contentType = self::contentTypes['updateAIAgent'][0]) + public function getAgentOverlayAsync($organisation, $agent_id, string $contentType = self::contentTypes['getAgentOverlay'][0]) { - return $this->updateAIAgentAsyncWithHttpInfo($organisation, $agent_id, $update_ai_agent_request, $contentType) + return $this->getAgentOverlayAsyncWithHttpInfo($organisation, $agent_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1758,22 +1769,21 @@ function ($response) { } /** - * Operation updateAIAgentAsyncWithHttpInfo + * Operation getAgentOverlayAsyncWithHttpInfo * - * Update Agent + * Get Agent Overlay * * @param string $organisation The organisation ID (required) - * @param string $agent_id The agent ID (required) - * @param \QuantClient\Model\UpdateAIAgentRequest $update_ai_agent_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAIAgent'] to see the possible values for this operation + * @param string $agent_id Global agent identifier (e.g., 'quantgov-code') (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAgentOverlay'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAIAgentAsyncWithHttpInfo($organisation, $agent_id, $update_ai_agent_request, string $contentType = self::contentTypes['updateAIAgent'][0]) + public function getAgentOverlayAsyncWithHttpInfo($organisation, $agent_id, string $contentType = self::contentTypes['getAgentOverlay'][0]) { - $returnType = '\QuantClient\Model\UpdateAIAgent200Response'; - $request = $this->updateAIAgentRequest($organisation, $agent_id, $update_ai_agent_request, $contentType); + $returnType = '\QuantClient\Model\GetAgentOverlay200Response'; + $request = $this->getAgentOverlayRequest($organisation, $agent_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1812,42 +1822,34 @@ function ($exception) { } /** - * Create request for operation 'updateAIAgent' + * Create request for operation 'getAgentOverlay' * * @param string $organisation The organisation ID (required) - * @param string $agent_id The agent ID (required) - * @param \QuantClient\Model\UpdateAIAgentRequest $update_ai_agent_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAIAgent'] to see the possible values for this operation + * @param string $agent_id Global agent identifier (e.g., 'quantgov-code') (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAgentOverlay'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateAIAgentRequest($organisation, $agent_id, $update_ai_agent_request, string $contentType = self::contentTypes['updateAIAgent'][0]) + public function getAgentOverlayRequest($organisation, $agent_id, string $contentType = self::contentTypes['getAgentOverlay'][0]) { // verify the required parameter 'organisation' is set if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $organisation when calling updateAIAgent' + 'Missing the required parameter $organisation when calling getAgentOverlay' ); } // verify the required parameter 'agent_id' is set if ($agent_id === null || (is_array($agent_id) && count($agent_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $agent_id when calling updateAIAgent' - ); - } - - // verify the required parameter 'update_ai_agent_request' is set - if ($update_ai_agent_request === null || (is_array($update_ai_agent_request) && count($update_ai_agent_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $update_ai_agent_request when calling updateAIAgent' + 'Missing the required parameter $agent_id when calling getAgentOverlay' ); } - $resourcePath = '/api/v3/organizations/{organisation}/ai/agents/{agentId}'; + $resourcePath = '/api/v3/organizations/{organisation}/ai/agents/{agentId}/overlay'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1881,12 +1883,914 @@ public function updateAIAgentRequest($organisation, $agent_id, $update_ai_agent_ ); // for model (json/xml) - if (isset($update_ai_agent_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_ai_agent_request)); + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { - $httpBody = $update_ai_agent_request; + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listAIAgents + * + * List AI Agents + * + * @param string $organisation The organisation ID (required) + * @param string|null $group Optional group filter (e.g., 'development', 'compliance') (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAIAgents'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\ListAIAgents200Response + */ + public function listAIAgents($organisation, $group = null, string $contentType = self::contentTypes['listAIAgents'][0]) + { + list($response) = $this->listAIAgentsWithHttpInfo($organisation, $group, $contentType); + return $response; + } + + /** + * Operation listAIAgentsWithHttpInfo + * + * List AI Agents + * + * @param string $organisation The organisation ID (required) + * @param string|null $group Optional group filter (e.g., 'development', 'compliance') (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAIAgents'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\ListAIAgents200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listAIAgentsWithHttpInfo($organisation, $group = null, string $contentType = self::contentTypes['listAIAgents'][0]) + { + $request = $this->listAIAgentsRequest($organisation, $group, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\ListAIAgents200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\ListAIAgents200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\ListAIAgents200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation listAIAgentsAsync + * + * List AI Agents + * + * @param string $organisation The organisation ID (required) + * @param string|null $group Optional group filter (e.g., 'development', 'compliance') (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAIAgents'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listAIAgentsAsync($organisation, $group = null, string $contentType = self::contentTypes['listAIAgents'][0]) + { + return $this->listAIAgentsAsyncWithHttpInfo($organisation, $group, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listAIAgentsAsyncWithHttpInfo + * + * List AI Agents + * + * @param string $organisation The organisation ID (required) + * @param string|null $group Optional group filter (e.g., 'development', 'compliance') (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAIAgents'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listAIAgentsAsyncWithHttpInfo($organisation, $group = null, string $contentType = self::contentTypes['listAIAgents'][0]) + { + $returnType = '\QuantClient\Model\ListAIAgents200Response'; + $request = $this->listAIAgentsRequest($organisation, $group, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listAIAgents' + * + * @param string $organisation The organisation ID (required) + * @param string|null $group Optional group filter (e.g., 'development', 'compliance') (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAIAgents'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listAIAgentsRequest($organisation, $group = null, string $contentType = self::contentTypes['listAIAgents'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling listAIAgents' + ); + } + + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/agents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $group, + 'group', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateAIAgent + * + * Update Agent + * + * @param string $organisation The organisation ID (required) + * @param string $agent_id The agent ID (required) + * @param \QuantClient\Model\UpdateAIAgentRequest $update_ai_agent_request update_ai_agent_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAIAgent'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\UpdateAIAgent200Response + */ + public function updateAIAgent($organisation, $agent_id, $update_ai_agent_request, string $contentType = self::contentTypes['updateAIAgent'][0]) + { + list($response) = $this->updateAIAgentWithHttpInfo($organisation, $agent_id, $update_ai_agent_request, $contentType); + return $response; + } + + /** + * Operation updateAIAgentWithHttpInfo + * + * Update Agent + * + * @param string $organisation The organisation ID (required) + * @param string $agent_id The agent ID (required) + * @param \QuantClient\Model\UpdateAIAgentRequest $update_ai_agent_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAIAgent'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\UpdateAIAgent200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function updateAIAgentWithHttpInfo($organisation, $agent_id, $update_ai_agent_request, string $contentType = self::contentTypes['updateAIAgent'][0]) + { + $request = $this->updateAIAgentRequest($organisation, $agent_id, $update_ai_agent_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\UpdateAIAgent200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\UpdateAIAgent200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\UpdateAIAgent200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation updateAIAgentAsync + * + * Update Agent + * + * @param string $organisation The organisation ID (required) + * @param string $agent_id The agent ID (required) + * @param \QuantClient\Model\UpdateAIAgentRequest $update_ai_agent_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAIAgent'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateAIAgentAsync($organisation, $agent_id, $update_ai_agent_request, string $contentType = self::contentTypes['updateAIAgent'][0]) + { + return $this->updateAIAgentAsyncWithHttpInfo($organisation, $agent_id, $update_ai_agent_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateAIAgentAsyncWithHttpInfo + * + * Update Agent + * + * @param string $organisation The organisation ID (required) + * @param string $agent_id The agent ID (required) + * @param \QuantClient\Model\UpdateAIAgentRequest $update_ai_agent_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAIAgent'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateAIAgentAsyncWithHttpInfo($organisation, $agent_id, $update_ai_agent_request, string $contentType = self::contentTypes['updateAIAgent'][0]) + { + $returnType = '\QuantClient\Model\UpdateAIAgent200Response'; + $request = $this->updateAIAgentRequest($organisation, $agent_id, $update_ai_agent_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateAIAgent' + * + * @param string $organisation The organisation ID (required) + * @param string $agent_id The agent ID (required) + * @param \QuantClient\Model\UpdateAIAgentRequest $update_ai_agent_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAIAgent'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateAIAgentRequest($organisation, $agent_id, $update_ai_agent_request, string $contentType = self::contentTypes['updateAIAgent'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling updateAIAgent' + ); + } + + // verify the required parameter 'agent_id' is set + if ($agent_id === null || (is_array($agent_id) && count($agent_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $agent_id when calling updateAIAgent' + ); + } + + // verify the required parameter 'update_ai_agent_request' is set + if ($update_ai_agent_request === null || (is_array($update_ai_agent_request) && count($update_ai_agent_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_ai_agent_request when calling updateAIAgent' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/agents/{agentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($agent_id !== null) { + $resourcePath = str_replace( + '{' . 'agentId' . '}', + ObjectSerializer::toPathValue($agent_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_ai_agent_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_ai_agent_request)); + } else { + $httpBody = $update_ai_agent_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation upsertAgentOverlay + * + * Upsert Agent Overlay + * + * @param string $organisation The organisation ID (required) + * @param string $agent_id Global agent identifier (required) + * @param \QuantClient\Model\UpsertAgentOverlayRequest $upsert_agent_overlay_request upsert_agent_overlay_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsertAgentOverlay'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\UpsertAgentOverlay200Response + */ + public function upsertAgentOverlay($organisation, $agent_id, $upsert_agent_overlay_request, string $contentType = self::contentTypes['upsertAgentOverlay'][0]) + { + list($response) = $this->upsertAgentOverlayWithHttpInfo($organisation, $agent_id, $upsert_agent_overlay_request, $contentType); + return $response; + } + + /** + * Operation upsertAgentOverlayWithHttpInfo + * + * Upsert Agent Overlay + * + * @param string $organisation The organisation ID (required) + * @param string $agent_id Global agent identifier (required) + * @param \QuantClient\Model\UpsertAgentOverlayRequest $upsert_agent_overlay_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsertAgentOverlay'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\UpsertAgentOverlay200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function upsertAgentOverlayWithHttpInfo($organisation, $agent_id, $upsert_agent_overlay_request, string $contentType = self::contentTypes['upsertAgentOverlay'][0]) + { + $request = $this->upsertAgentOverlayRequest($organisation, $agent_id, $upsert_agent_overlay_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\UpsertAgentOverlay200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\UpsertAgentOverlay200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\UpsertAgentOverlay200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation upsertAgentOverlayAsync + * + * Upsert Agent Overlay + * + * @param string $organisation The organisation ID (required) + * @param string $agent_id Global agent identifier (required) + * @param \QuantClient\Model\UpsertAgentOverlayRequest $upsert_agent_overlay_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsertAgentOverlay'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function upsertAgentOverlayAsync($organisation, $agent_id, $upsert_agent_overlay_request, string $contentType = self::contentTypes['upsertAgentOverlay'][0]) + { + return $this->upsertAgentOverlayAsyncWithHttpInfo($organisation, $agent_id, $upsert_agent_overlay_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation upsertAgentOverlayAsyncWithHttpInfo + * + * Upsert Agent Overlay + * + * @param string $organisation The organisation ID (required) + * @param string $agent_id Global agent identifier (required) + * @param \QuantClient\Model\UpsertAgentOverlayRequest $upsert_agent_overlay_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsertAgentOverlay'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function upsertAgentOverlayAsyncWithHttpInfo($organisation, $agent_id, $upsert_agent_overlay_request, string $contentType = self::contentTypes['upsertAgentOverlay'][0]) + { + $returnType = '\QuantClient\Model\UpsertAgentOverlay200Response'; + $request = $this->upsertAgentOverlayRequest($organisation, $agent_id, $upsert_agent_overlay_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'upsertAgentOverlay' + * + * @param string $organisation The organisation ID (required) + * @param string $agent_id Global agent identifier (required) + * @param \QuantClient\Model\UpsertAgentOverlayRequest $upsert_agent_overlay_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsertAgentOverlay'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function upsertAgentOverlayRequest($organisation, $agent_id, $upsert_agent_overlay_request, string $contentType = self::contentTypes['upsertAgentOverlay'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling upsertAgentOverlay' + ); + } + + // verify the required parameter 'agent_id' is set + if ($agent_id === null || (is_array($agent_id) && count($agent_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $agent_id when calling upsertAgentOverlay' + ); + } + + // verify the required parameter 'upsert_agent_overlay_request' is set + if ($upsert_agent_overlay_request === null || (is_array($upsert_agent_overlay_request) && count($upsert_agent_overlay_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $upsert_agent_overlay_request when calling upsertAgentOverlay' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/agents/{agentId}/overlay'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($agent_id !== null) { + $resourcePath = str_replace( + '{' . 'agentId' . '}', + ObjectSerializer::toPathValue($agent_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($upsert_agent_overlay_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($upsert_agent_overlay_request)); + } else { + $httpBody = $upsert_agent_overlay_request; } } elseif (count($formParams) > 0) { if ($multipart) { diff --git a/src/Api/OrchestrationApi.php b/src/Api/AIApi.php similarity index 59% rename from src/Api/OrchestrationApi.php rename to src/Api/AIApi.php index c6803d67..b29f414f 100644 --- a/src/Api/OrchestrationApi.php +++ b/src/Api/AIApi.php @@ -1,6 +1,6 @@ [ + 'getAIUsageStats' => [ 'application/json', ], ]; @@ -126,40 +126,47 @@ public function getConfig() } /** - * Operation getAIOrchestrationStatus + * Operation getAIUsageStats * - * Get Orchestration Status + * Organisation AI usage breakdown (subscription page parity) * - * @param string $organisation The organisation ID (required) - * @param string $orchestration_id Orchestration identifier for aggregated async tool executions (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIOrchestrationStatus'] to see the possible values for this operation + * @param string $organisation organisation (required) + * @param string|null $month YYYY-MM, defaults to current month (optional) + * @param string|null $group_by group_by (optional, default to 'model') + * @param string|null $include Set to 'daily' to append a 30-day series (optional) + * @param string|null $user_id Scope the daily series to a user (optional) + * @param string|null $token_id Scope the daily series to a token (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIUsageStats'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \QuantClient\Model\GetAIOrchestrationStatus200Response|\QuantClient\Model\GetAIOrchestrationStatus404Response + * @return void */ - public function getAIOrchestrationStatus($organisation, $orchestration_id, string $contentType = self::contentTypes['getAIOrchestrationStatus'][0]) + public function getAIUsageStats($organisation, $month = null, $group_by = 'model', $include = null, $user_id = null, $token_id = null, string $contentType = self::contentTypes['getAIUsageStats'][0]) { - list($response) = $this->getAIOrchestrationStatusWithHttpInfo($organisation, $orchestration_id, $contentType); - return $response; + $this->getAIUsageStatsWithHttpInfo($organisation, $month, $group_by, $include, $user_id, $token_id, $contentType); } /** - * Operation getAIOrchestrationStatusWithHttpInfo + * Operation getAIUsageStatsWithHttpInfo * - * Get Orchestration Status + * Organisation AI usage breakdown (subscription page parity) * - * @param string $organisation The organisation ID (required) - * @param string $orchestration_id Orchestration identifier for aggregated async tool executions (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIOrchestrationStatus'] to see the possible values for this operation + * @param string $organisation (required) + * @param string|null $month YYYY-MM, defaults to current month (optional) + * @param string|null $group_by (optional, default to 'model') + * @param string|null $include Set to 'daily' to append a 30-day series (optional) + * @param string|null $user_id Scope the daily series to a user (optional) + * @param string|null $token_id Scope the daily series to a token (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIUsageStats'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \QuantClient\Model\GetAIOrchestrationStatus200Response|\QuantClient\Model\GetAIOrchestrationStatus404Response, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getAIOrchestrationStatusWithHttpInfo($organisation, $orchestration_id, string $contentType = self::contentTypes['getAIOrchestrationStatus'][0]) + public function getAIUsageStatsWithHttpInfo($organisation, $month = null, $group_by = 'model', $include = null, $user_id = null, $token_id = null, string $contentType = self::contentTypes['getAIUsageStats'][0]) { - $request = $this->getAIOrchestrationStatusRequest($organisation, $orchestration_id, $contentType); + $request = $this->getAIUsageStatsRequest($organisation, $month, $group_by, $include, $user_id, $token_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -184,59 +191,9 @@ public function getAIOrchestrationStatusWithHttpInfo($organisation, $orchestrati $statusCode = $response->getStatusCode(); - switch($statusCode) { - case 200: - return $this->handleResponseWithDataType( - '\QuantClient\Model\GetAIOrchestrationStatus200Response', - $request, - $response, - ); - case 404: - return $this->handleResponseWithDataType( - '\QuantClient\Model\GetAIOrchestrationStatus404Response', - $request, - $response, - ); - } - - - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - return $this->handleResponseWithDataType( - '\QuantClient\Model\GetAIOrchestrationStatus200Response', - $request, - $response, - ); + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\QuantClient\Model\GetAIOrchestrationStatus200Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - throw $e; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\QuantClient\Model\GetAIOrchestrationStatus404Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - throw $e; } @@ -245,20 +202,24 @@ public function getAIOrchestrationStatusWithHttpInfo($organisation, $orchestrati } /** - * Operation getAIOrchestrationStatusAsync + * Operation getAIUsageStatsAsync * - * Get Orchestration Status + * Organisation AI usage breakdown (subscription page parity) * - * @param string $organisation The organisation ID (required) - * @param string $orchestration_id Orchestration identifier for aggregated async tool executions (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIOrchestrationStatus'] to see the possible values for this operation + * @param string $organisation (required) + * @param string|null $month YYYY-MM, defaults to current month (optional) + * @param string|null $group_by (optional, default to 'model') + * @param string|null $include Set to 'daily' to append a 30-day series (optional) + * @param string|null $user_id Scope the daily series to a user (optional) + * @param string|null $token_id Scope the daily series to a token (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIUsageStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAIOrchestrationStatusAsync($organisation, $orchestration_id, string $contentType = self::contentTypes['getAIOrchestrationStatus'][0]) + public function getAIUsageStatsAsync($organisation, $month = null, $group_by = 'model', $include = null, $user_id = null, $token_id = null, string $contentType = self::contentTypes['getAIUsageStats'][0]) { - return $this->getAIOrchestrationStatusAsyncWithHttpInfo($organisation, $orchestration_id, $contentType) + return $this->getAIUsageStatsAsyncWithHttpInfo($organisation, $month, $group_by, $include, $user_id, $token_id, $contentType) ->then( function ($response) { return $response[0]; @@ -267,40 +228,31 @@ function ($response) { } /** - * Operation getAIOrchestrationStatusAsyncWithHttpInfo + * Operation getAIUsageStatsAsyncWithHttpInfo * - * Get Orchestration Status + * Organisation AI usage breakdown (subscription page parity) * - * @param string $organisation The organisation ID (required) - * @param string $orchestration_id Orchestration identifier for aggregated async tool executions (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIOrchestrationStatus'] to see the possible values for this operation + * @param string $organisation (required) + * @param string|null $month YYYY-MM, defaults to current month (optional) + * @param string|null $group_by (optional, default to 'model') + * @param string|null $include Set to 'daily' to append a 30-day series (optional) + * @param string|null $user_id Scope the daily series to a user (optional) + * @param string|null $token_id Scope the daily series to a token (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIUsageStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAIOrchestrationStatusAsyncWithHttpInfo($organisation, $orchestration_id, string $contentType = self::contentTypes['getAIOrchestrationStatus'][0]) + public function getAIUsageStatsAsyncWithHttpInfo($organisation, $month = null, $group_by = 'model', $include = null, $user_id = null, $token_id = null, string $contentType = self::contentTypes['getAIUsageStats'][0]) { - $returnType = '\QuantClient\Model\GetAIOrchestrationStatus200Response'; - $request = $this->getAIOrchestrationStatusRequest($organisation, $orchestration_id, $contentType); + $returnType = ''; + $request = $this->getAIUsageStatsRequest($organisation, $month, $group_by, $include, $user_id, $token_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -320,43 +272,87 @@ function ($exception) { } /** - * Create request for operation 'getAIOrchestrationStatus' + * Create request for operation 'getAIUsageStats' * - * @param string $organisation The organisation ID (required) - * @param string $orchestration_id Orchestration identifier for aggregated async tool executions (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIOrchestrationStatus'] to see the possible values for this operation + * @param string $organisation (required) + * @param string|null $month YYYY-MM, defaults to current month (optional) + * @param string|null $group_by (optional, default to 'model') + * @param string|null $include Set to 'daily' to append a 30-day series (optional) + * @param string|null $user_id Scope the daily series to a user (optional) + * @param string|null $token_id Scope the daily series to a token (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIUsageStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getAIOrchestrationStatusRequest($organisation, $orchestration_id, string $contentType = self::contentTypes['getAIOrchestrationStatus'][0]) + public function getAIUsageStatsRequest($organisation, $month = null, $group_by = 'model', $include = null, $user_id = null, $token_id = null, string $contentType = self::contentTypes['getAIUsageStats'][0]) { // verify the required parameter 'organisation' is set if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $organisation when calling getAIOrchestrationStatus' + 'Missing the required parameter $organisation when calling getAIUsageStats' ); } - // verify the required parameter 'orchestration_id' is set - if ($orchestration_id === null || (is_array($orchestration_id) && count($orchestration_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $orchestration_id when calling getAIOrchestrationStatus' - ); - } - if (!preg_match("/^orch_[a-f0-9]{32}$/", $orchestration_id)) { - throw new \InvalidArgumentException("invalid value for \"orchestration_id\" when calling OrchestrationApi.getAIOrchestrationStatus, must conform to the pattern /^orch_[a-f0-9]{32}$/."); - } - - $resourcePath = '/api/v3/organizations/{organisation}/ai/tools/orchestrations/{orchestrationId}'; + + + + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/usage'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $month, + 'month', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $group_by, + 'groupBy', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include, + 'include', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $user_id, + 'userId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $token_id, + 'tokenId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -367,18 +363,10 @@ public function getAIOrchestrationStatusRequest($organisation, $orchestration_id $resourcePath ); } - // path params - if ($orchestration_id !== null) { - $resourcePath = str_replace( - '{' . 'orchestrationId' . '}', - ObjectSerializer::toPathValue($orchestration_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( - ['application/json', ], + [], $contentType, $multipart ); diff --git a/src/Api/AICustomToolsApi.php b/src/Api/AICustomToolsApi.php index e3d48d7b..cd000f6d 100644 --- a/src/Api/AICustomToolsApi.php +++ b/src/Api/AICustomToolsApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -80,6 +80,9 @@ class AICustomToolsApi 'deleteCustomTool' => [ 'application/json', ], + 'getCustomTool' => [ + 'application/json', + ], 'listCustomTools' => [ 'application/json', ], @@ -714,6 +717,298 @@ public function deleteCustomToolRequest($organisation, $tool_name, string $conte ); } + /** + * Operation getCustomTool + * + * Get Custom Tool + * + * @param string $organisation The organisation ID (required) + * @param string $tool_name The tool name to retrieve (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCustomTool'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\GetCustomTool200Response + */ + public function getCustomTool($organisation, $tool_name, string $contentType = self::contentTypes['getCustomTool'][0]) + { + list($response) = $this->getCustomToolWithHttpInfo($organisation, $tool_name, $contentType); + return $response; + } + + /** + * Operation getCustomToolWithHttpInfo + * + * Get Custom Tool + * + * @param string $organisation The organisation ID (required) + * @param string $tool_name The tool name to retrieve (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCustomTool'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\GetCustomTool200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getCustomToolWithHttpInfo($organisation, $tool_name, string $contentType = self::contentTypes['getCustomTool'][0]) + { + $request = $this->getCustomToolRequest($organisation, $tool_name, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\GetCustomTool200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\GetCustomTool200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\GetCustomTool200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getCustomToolAsync + * + * Get Custom Tool + * + * @param string $organisation The organisation ID (required) + * @param string $tool_name The tool name to retrieve (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCustomTool'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCustomToolAsync($organisation, $tool_name, string $contentType = self::contentTypes['getCustomTool'][0]) + { + return $this->getCustomToolAsyncWithHttpInfo($organisation, $tool_name, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCustomToolAsyncWithHttpInfo + * + * Get Custom Tool + * + * @param string $organisation The organisation ID (required) + * @param string $tool_name The tool name to retrieve (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCustomTool'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCustomToolAsyncWithHttpInfo($organisation, $tool_name, string $contentType = self::contentTypes['getCustomTool'][0]) + { + $returnType = '\QuantClient\Model\GetCustomTool200Response'; + $request = $this->getCustomToolRequest($organisation, $tool_name, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCustomTool' + * + * @param string $organisation The organisation ID (required) + * @param string $tool_name The tool name to retrieve (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCustomTool'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getCustomToolRequest($organisation, $tool_name, string $contentType = self::contentTypes['getCustomTool'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling getCustomTool' + ); + } + + // verify the required parameter 'tool_name' is set + if ($tool_name === null || (is_array($tool_name) && count($tool_name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tool_name when calling getCustomTool' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/custom-tools/{toolName}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($tool_name !== null) { + $resourcePath = str_replace( + '{' . 'toolName' . '}', + ObjectSerializer::toPathValue($tool_name), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listCustomTools * diff --git a/src/Api/AIFileStorageApi.php b/src/Api/AIFileStorageApi.php index 04134040..5c0facd4 100644 --- a/src/Api/AIFileStorageApi.php +++ b/src/Api/AIFileStorageApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/AIFilterPoliciesApi.php b/src/Api/AIFilterPoliciesApi.php new file mode 100644 index 00000000..517f7ea8 --- /dev/null +++ b/src/Api/AIFilterPoliciesApi.php @@ -0,0 +1,2249 @@ + [ + 'application/json', + ], + 'deleteFilterPolicy' => [ + 'application/json', + ], + 'disableFilterPolicy' => [ + 'application/json', + ], + 'enableFilterPolicy' => [ + 'application/json', + ], + 'getFilterPolicy' => [ + 'application/json', + ], + 'listFilterPolicies' => [ + 'application/json', + ], + 'updateFilterPolicy' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createFilterPolicy + * + * Create an AI filter policy for an organisation + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\CreateFilterPolicyRequest $create_filter_policy_request create_filter_policy_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFilterPolicy'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return object + */ + public function createFilterPolicy($organisation, $create_filter_policy_request, string $contentType = self::contentTypes['createFilterPolicy'][0]) + { + list($response) = $this->createFilterPolicyWithHttpInfo($organisation, $create_filter_policy_request, $contentType); + return $response; + } + + /** + * Operation createFilterPolicyWithHttpInfo + * + * Create an AI filter policy for an organisation + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\CreateFilterPolicyRequest $create_filter_policy_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFilterPolicy'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function createFilterPolicyWithHttpInfo($organisation, $create_filter_policy_request, string $contentType = self::contentTypes['createFilterPolicy'][0]) + { + $request = $this->createFilterPolicyRequest($organisation, $create_filter_policy_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation createFilterPolicyAsync + * + * Create an AI filter policy for an organisation + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\CreateFilterPolicyRequest $create_filter_policy_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createFilterPolicyAsync($organisation, $create_filter_policy_request, string $contentType = self::contentTypes['createFilterPolicy'][0]) + { + return $this->createFilterPolicyAsyncWithHttpInfo($organisation, $create_filter_policy_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createFilterPolicyAsyncWithHttpInfo + * + * Create an AI filter policy for an organisation + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\CreateFilterPolicyRequest $create_filter_policy_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createFilterPolicyAsyncWithHttpInfo($organisation, $create_filter_policy_request, string $contentType = self::contentTypes['createFilterPolicy'][0]) + { + $returnType = 'object'; + $request = $this->createFilterPolicyRequest($organisation, $create_filter_policy_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createFilterPolicy' + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\CreateFilterPolicyRequest $create_filter_policy_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createFilterPolicyRequest($organisation, $create_filter_policy_request, string $contentType = self::contentTypes['createFilterPolicy'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling createFilterPolicy' + ); + } + + // verify the required parameter 'create_filter_policy_request' is set + if ($create_filter_policy_request === null || (is_array($create_filter_policy_request) && count($create_filter_policy_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $create_filter_policy_request when calling createFilterPolicy' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/filter-policies'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($create_filter_policy_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_filter_policy_request)); + } else { + $httpBody = $create_filter_policy_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteFilterPolicy + * + * Delete a specific AI filter policy + * + * @param string $organisation organisation (required) + * @param string $policy_id policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFilterPolicy'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return object + */ + public function deleteFilterPolicy($organisation, $policy_id, string $contentType = self::contentTypes['deleteFilterPolicy'][0]) + { + list($response) = $this->deleteFilterPolicyWithHttpInfo($organisation, $policy_id, $contentType); + return $response; + } + + /** + * Operation deleteFilterPolicyWithHttpInfo + * + * Delete a specific AI filter policy + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFilterPolicy'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteFilterPolicyWithHttpInfo($organisation, $policy_id, string $contentType = self::contentTypes['deleteFilterPolicy'][0]) + { + $request = $this->deleteFilterPolicyRequest($organisation, $policy_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation deleteFilterPolicyAsync + * + * Delete a specific AI filter policy + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteFilterPolicyAsync($organisation, $policy_id, string $contentType = self::contentTypes['deleteFilterPolicy'][0]) + { + return $this->deleteFilterPolicyAsyncWithHttpInfo($organisation, $policy_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteFilterPolicyAsyncWithHttpInfo + * + * Delete a specific AI filter policy + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteFilterPolicyAsyncWithHttpInfo($organisation, $policy_id, string $contentType = self::contentTypes['deleteFilterPolicy'][0]) + { + $returnType = 'object'; + $request = $this->deleteFilterPolicyRequest($organisation, $policy_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteFilterPolicy' + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteFilterPolicyRequest($organisation, $policy_id, string $contentType = self::contentTypes['deleteFilterPolicy'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling deleteFilterPolicy' + ); + } + + // verify the required parameter 'policy_id' is set + if ($policy_id === null || (is_array($policy_id) && count($policy_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $policy_id when calling deleteFilterPolicy' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/filter-policies/{policyId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($policy_id !== null) { + $resourcePath = str_replace( + '{' . 'policyId' . '}', + ObjectSerializer::toPathValue($policy_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation disableFilterPolicy + * + * Disable a specific AI filter policy + * + * @param string $organisation organisation (required) + * @param string $policy_id policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['disableFilterPolicy'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return object + */ + public function disableFilterPolicy($organisation, $policy_id, string $contentType = self::contentTypes['disableFilterPolicy'][0]) + { + list($response) = $this->disableFilterPolicyWithHttpInfo($organisation, $policy_id, $contentType); + return $response; + } + + /** + * Operation disableFilterPolicyWithHttpInfo + * + * Disable a specific AI filter policy + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['disableFilterPolicy'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function disableFilterPolicyWithHttpInfo($organisation, $policy_id, string $contentType = self::contentTypes['disableFilterPolicy'][0]) + { + $request = $this->disableFilterPolicyRequest($organisation, $policy_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation disableFilterPolicyAsync + * + * Disable a specific AI filter policy + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['disableFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function disableFilterPolicyAsync($organisation, $policy_id, string $contentType = self::contentTypes['disableFilterPolicy'][0]) + { + return $this->disableFilterPolicyAsyncWithHttpInfo($organisation, $policy_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation disableFilterPolicyAsyncWithHttpInfo + * + * Disable a specific AI filter policy + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['disableFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function disableFilterPolicyAsyncWithHttpInfo($organisation, $policy_id, string $contentType = self::contentTypes['disableFilterPolicy'][0]) + { + $returnType = 'object'; + $request = $this->disableFilterPolicyRequest($organisation, $policy_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'disableFilterPolicy' + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['disableFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function disableFilterPolicyRequest($organisation, $policy_id, string $contentType = self::contentTypes['disableFilterPolicy'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling disableFilterPolicy' + ); + } + + // verify the required parameter 'policy_id' is set + if ($policy_id === null || (is_array($policy_id) && count($policy_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $policy_id when calling disableFilterPolicy' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/filter-policies/{policyId}/disable'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($policy_id !== null) { + $resourcePath = str_replace( + '{' . 'policyId' . '}', + ObjectSerializer::toPathValue($policy_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation enableFilterPolicy + * + * Enable a specific AI filter policy + * + * @param string $organisation organisation (required) + * @param string $policy_id policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['enableFilterPolicy'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return object + */ + public function enableFilterPolicy($organisation, $policy_id, string $contentType = self::contentTypes['enableFilterPolicy'][0]) + { + list($response) = $this->enableFilterPolicyWithHttpInfo($organisation, $policy_id, $contentType); + return $response; + } + + /** + * Operation enableFilterPolicyWithHttpInfo + * + * Enable a specific AI filter policy + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['enableFilterPolicy'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function enableFilterPolicyWithHttpInfo($organisation, $policy_id, string $contentType = self::contentTypes['enableFilterPolicy'][0]) + { + $request = $this->enableFilterPolicyRequest($organisation, $policy_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation enableFilterPolicyAsync + * + * Enable a specific AI filter policy + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['enableFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function enableFilterPolicyAsync($organisation, $policy_id, string $contentType = self::contentTypes['enableFilterPolicy'][0]) + { + return $this->enableFilterPolicyAsyncWithHttpInfo($organisation, $policy_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation enableFilterPolicyAsyncWithHttpInfo + * + * Enable a specific AI filter policy + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['enableFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function enableFilterPolicyAsyncWithHttpInfo($organisation, $policy_id, string $contentType = self::contentTypes['enableFilterPolicy'][0]) + { + $returnType = 'object'; + $request = $this->enableFilterPolicyRequest($organisation, $policy_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'enableFilterPolicy' + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['enableFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function enableFilterPolicyRequest($organisation, $policy_id, string $contentType = self::contentTypes['enableFilterPolicy'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling enableFilterPolicy' + ); + } + + // verify the required parameter 'policy_id' is set + if ($policy_id === null || (is_array($policy_id) && count($policy_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $policy_id when calling enableFilterPolicy' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/filter-policies/{policyId}/enable'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($policy_id !== null) { + $resourcePath = str_replace( + '{' . 'policyId' . '}', + ObjectSerializer::toPathValue($policy_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFilterPolicy + * + * Get a specific AI filter policy + * + * @param string $organisation organisation (required) + * @param string $policy_id policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFilterPolicy'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return object + */ + public function getFilterPolicy($organisation, $policy_id, string $contentType = self::contentTypes['getFilterPolicy'][0]) + { + list($response) = $this->getFilterPolicyWithHttpInfo($organisation, $policy_id, $contentType); + return $response; + } + + /** + * Operation getFilterPolicyWithHttpInfo + * + * Get a specific AI filter policy + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFilterPolicy'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function getFilterPolicyWithHttpInfo($organisation, $policy_id, string $contentType = self::contentTypes['getFilterPolicy'][0]) + { + $request = $this->getFilterPolicyRequest($organisation, $policy_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getFilterPolicyAsync + * + * Get a specific AI filter policy + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFilterPolicyAsync($organisation, $policy_id, string $contentType = self::contentTypes['getFilterPolicy'][0]) + { + return $this->getFilterPolicyAsyncWithHttpInfo($organisation, $policy_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFilterPolicyAsyncWithHttpInfo + * + * Get a specific AI filter policy + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFilterPolicyAsyncWithHttpInfo($organisation, $policy_id, string $contentType = self::contentTypes['getFilterPolicy'][0]) + { + $returnType = 'object'; + $request = $this->getFilterPolicyRequest($organisation, $policy_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFilterPolicy' + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getFilterPolicyRequest($organisation, $policy_id, string $contentType = self::contentTypes['getFilterPolicy'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling getFilterPolicy' + ); + } + + // verify the required parameter 'policy_id' is set + if ($policy_id === null || (is_array($policy_id) && count($policy_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $policy_id when calling getFilterPolicy' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/filter-policies/{policyId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($policy_id !== null) { + $resourcePath = str_replace( + '{' . 'policyId' . '}', + ObjectSerializer::toPathValue($policy_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listFilterPolicies + * + * List AI filter policies for an organisation + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFilterPolicies'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return object + */ + public function listFilterPolicies($organisation, string $contentType = self::contentTypes['listFilterPolicies'][0]) + { + list($response) = $this->listFilterPoliciesWithHttpInfo($organisation, $contentType); + return $response; + } + + /** + * Operation listFilterPoliciesWithHttpInfo + * + * List AI filter policies for an organisation + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFilterPolicies'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function listFilterPoliciesWithHttpInfo($organisation, string $contentType = self::contentTypes['listFilterPolicies'][0]) + { + $request = $this->listFilterPoliciesRequest($organisation, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation listFilterPoliciesAsync + * + * List AI filter policies for an organisation + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFilterPolicies'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listFilterPoliciesAsync($organisation, string $contentType = self::contentTypes['listFilterPolicies'][0]) + { + return $this->listFilterPoliciesAsyncWithHttpInfo($organisation, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listFilterPoliciesAsyncWithHttpInfo + * + * List AI filter policies for an organisation + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFilterPolicies'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listFilterPoliciesAsyncWithHttpInfo($organisation, string $contentType = self::contentTypes['listFilterPolicies'][0]) + { + $returnType = 'object'; + $request = $this->listFilterPoliciesRequest($organisation, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listFilterPolicies' + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFilterPolicies'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listFilterPoliciesRequest($organisation, string $contentType = self::contentTypes['listFilterPolicies'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling listFilterPolicies' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/filter-policies'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateFilterPolicy + * + * Update a specific AI filter policy + * + * @param string $organisation organisation (required) + * @param string $policy_id policy_id (required) + * @param \QuantClient\Model\UpdateFilterPolicyRequest $update_filter_policy_request update_filter_policy_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFilterPolicy'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return object + */ + public function updateFilterPolicy($organisation, $policy_id, $update_filter_policy_request, string $contentType = self::contentTypes['updateFilterPolicy'][0]) + { + list($response) = $this->updateFilterPolicyWithHttpInfo($organisation, $policy_id, $update_filter_policy_request, $contentType); + return $response; + } + + /** + * Operation updateFilterPolicyWithHttpInfo + * + * Update a specific AI filter policy + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param \QuantClient\Model\UpdateFilterPolicyRequest $update_filter_policy_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFilterPolicy'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function updateFilterPolicyWithHttpInfo($organisation, $policy_id, $update_filter_policy_request, string $contentType = self::contentTypes['updateFilterPolicy'][0]) + { + $request = $this->updateFilterPolicyRequest($organisation, $policy_id, $update_filter_policy_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation updateFilterPolicyAsync + * + * Update a specific AI filter policy + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param \QuantClient\Model\UpdateFilterPolicyRequest $update_filter_policy_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateFilterPolicyAsync($organisation, $policy_id, $update_filter_policy_request, string $contentType = self::contentTypes['updateFilterPolicy'][0]) + { + return $this->updateFilterPolicyAsyncWithHttpInfo($organisation, $policy_id, $update_filter_policy_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateFilterPolicyAsyncWithHttpInfo + * + * Update a specific AI filter policy + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param \QuantClient\Model\UpdateFilterPolicyRequest $update_filter_policy_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateFilterPolicyAsyncWithHttpInfo($organisation, $policy_id, $update_filter_policy_request, string $contentType = self::contentTypes['updateFilterPolicy'][0]) + { + $returnType = 'object'; + $request = $this->updateFilterPolicyRequest($organisation, $policy_id, $update_filter_policy_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateFilterPolicy' + * + * @param string $organisation (required) + * @param string $policy_id (required) + * @param \QuantClient\Model\UpdateFilterPolicyRequest $update_filter_policy_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateFilterPolicy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateFilterPolicyRequest($organisation, $policy_id, $update_filter_policy_request, string $contentType = self::contentTypes['updateFilterPolicy'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling updateFilterPolicy' + ); + } + + // verify the required parameter 'policy_id' is set + if ($policy_id === null || (is_array($policy_id) && count($policy_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $policy_id when calling updateFilterPolicy' + ); + } + + // verify the required parameter 'update_filter_policy_request' is set + if ($update_filter_policy_request === null || (is_array($update_filter_policy_request) && count($update_filter_policy_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_filter_policy_request when calling updateFilterPolicy' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/filter-policies/{policyId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($policy_id !== null) { + $resourcePath = str_replace( + '{' . 'policyId' . '}', + ObjectSerializer::toPathValue($policy_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_filter_policy_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_filter_policy_request)); + } else { + $httpBody = $update_filter_policy_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/src/Api/AIGovernanceApi.php b/src/Api/AIGovernanceApi.php new file mode 100644 index 00000000..06fdf35a --- /dev/null +++ b/src/Api/AIGovernanceApi.php @@ -0,0 +1,1030 @@ + [ + 'application/json', + ], + 'getGovernanceSpend' => [ + 'application/json', + ], + 'updateGovernanceConfig' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getGovernanceConfig + * + * Get AI governance configuration for an organisation + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGovernanceConfig'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\GetGovernanceConfig200Response + */ + public function getGovernanceConfig($organisation, string $contentType = self::contentTypes['getGovernanceConfig'][0]) + { + list($response) = $this->getGovernanceConfigWithHttpInfo($organisation, $contentType); + return $response; + } + + /** + * Operation getGovernanceConfigWithHttpInfo + * + * Get AI governance configuration for an organisation + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGovernanceConfig'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\GetGovernanceConfig200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getGovernanceConfigWithHttpInfo($organisation, string $contentType = self::contentTypes['getGovernanceConfig'][0]) + { + $request = $this->getGovernanceConfigRequest($organisation, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\GetGovernanceConfig200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\GetGovernanceConfig200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\GetGovernanceConfig200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getGovernanceConfigAsync + * + * Get AI governance configuration for an organisation + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGovernanceConfig'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGovernanceConfigAsync($organisation, string $contentType = self::contentTypes['getGovernanceConfig'][0]) + { + return $this->getGovernanceConfigAsyncWithHttpInfo($organisation, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getGovernanceConfigAsyncWithHttpInfo + * + * Get AI governance configuration for an organisation + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGovernanceConfig'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGovernanceConfigAsyncWithHttpInfo($organisation, string $contentType = self::contentTypes['getGovernanceConfig'][0]) + { + $returnType = '\QuantClient\Model\GetGovernanceConfig200Response'; + $request = $this->getGovernanceConfigRequest($organisation, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getGovernanceConfig' + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGovernanceConfig'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getGovernanceConfigRequest($organisation, string $contentType = self::contentTypes['getGovernanceConfig'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling getGovernanceConfig' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/governance'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getGovernanceSpend + * + * Get AI spend summary for an organisation + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGovernanceSpend'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\GetGovernanceSpend200Response + */ + public function getGovernanceSpend($organisation, string $contentType = self::contentTypes['getGovernanceSpend'][0]) + { + list($response) = $this->getGovernanceSpendWithHttpInfo($organisation, $contentType); + return $response; + } + + /** + * Operation getGovernanceSpendWithHttpInfo + * + * Get AI spend summary for an organisation + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGovernanceSpend'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\GetGovernanceSpend200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getGovernanceSpendWithHttpInfo($organisation, string $contentType = self::contentTypes['getGovernanceSpend'][0]) + { + $request = $this->getGovernanceSpendRequest($organisation, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\GetGovernanceSpend200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\GetGovernanceSpend200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\GetGovernanceSpend200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getGovernanceSpendAsync + * + * Get AI spend summary for an organisation + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGovernanceSpend'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGovernanceSpendAsync($organisation, string $contentType = self::contentTypes['getGovernanceSpend'][0]) + { + return $this->getGovernanceSpendAsyncWithHttpInfo($organisation, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getGovernanceSpendAsyncWithHttpInfo + * + * Get AI spend summary for an organisation + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGovernanceSpend'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getGovernanceSpendAsyncWithHttpInfo($organisation, string $contentType = self::contentTypes['getGovernanceSpend'][0]) + { + $returnType = '\QuantClient\Model\GetGovernanceSpend200Response'; + $request = $this->getGovernanceSpendRequest($organisation, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getGovernanceSpend' + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getGovernanceSpend'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getGovernanceSpendRequest($organisation, string $contentType = self::contentTypes['getGovernanceSpend'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling getGovernanceSpend' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/governance/spend'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateGovernanceConfig + * + * Update AI governance configuration for an organisation + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\UpdateGovernanceConfigRequest $update_governance_config_request update_governance_config_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGovernanceConfig'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\UpdateGovernanceConfig200Response + */ + public function updateGovernanceConfig($organisation, $update_governance_config_request, string $contentType = self::contentTypes['updateGovernanceConfig'][0]) + { + list($response) = $this->updateGovernanceConfigWithHttpInfo($organisation, $update_governance_config_request, $contentType); + return $response; + } + + /** + * Operation updateGovernanceConfigWithHttpInfo + * + * Update AI governance configuration for an organisation + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\UpdateGovernanceConfigRequest $update_governance_config_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGovernanceConfig'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\UpdateGovernanceConfig200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function updateGovernanceConfigWithHttpInfo($organisation, $update_governance_config_request, string $contentType = self::contentTypes['updateGovernanceConfig'][0]) + { + $request = $this->updateGovernanceConfigRequest($organisation, $update_governance_config_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\UpdateGovernanceConfig200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\UpdateGovernanceConfig200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\UpdateGovernanceConfig200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation updateGovernanceConfigAsync + * + * Update AI governance configuration for an organisation + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\UpdateGovernanceConfigRequest $update_governance_config_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGovernanceConfig'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateGovernanceConfigAsync($organisation, $update_governance_config_request, string $contentType = self::contentTypes['updateGovernanceConfig'][0]) + { + return $this->updateGovernanceConfigAsyncWithHttpInfo($organisation, $update_governance_config_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateGovernanceConfigAsyncWithHttpInfo + * + * Update AI governance configuration for an organisation + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\UpdateGovernanceConfigRequest $update_governance_config_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGovernanceConfig'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateGovernanceConfigAsyncWithHttpInfo($organisation, $update_governance_config_request, string $contentType = self::contentTypes['updateGovernanceConfig'][0]) + { + $returnType = '\QuantClient\Model\UpdateGovernanceConfig200Response'; + $request = $this->updateGovernanceConfigRequest($organisation, $update_governance_config_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateGovernanceConfig' + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\UpdateGovernanceConfigRequest $update_governance_config_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGovernanceConfig'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateGovernanceConfigRequest($organisation, $update_governance_config_request, string $contentType = self::contentTypes['updateGovernanceConfig'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling updateGovernanceConfig' + ); + } + + // verify the required parameter 'update_governance_config_request' is set + if ($update_governance_config_request === null || (is_array($update_governance_config_request) && count($update_governance_config_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_governance_config_request when calling updateGovernanceConfig' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/governance'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_governance_config_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_governance_config_request)); + } else { + $httpBody = $update_governance_config_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/src/Api/AIInferenceApi.php b/src/Api/AIInferenceApi.php index f1216294..fd4efd4b 100644 --- a/src/Api/AIInferenceApi.php +++ b/src/Api/AIInferenceApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/AIModelsApi.php b/src/Api/AIModelsApi.php index f6d3f459..abc3c84f 100644 --- a/src/Api/AIModelsApi.php +++ b/src/Api/AIModelsApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/AIOrchestrationsApi.php b/src/Api/AIOrchestrationsApi.php new file mode 100644 index 00000000..0205dbf3 --- /dev/null +++ b/src/Api/AIOrchestrationsApi.php @@ -0,0 +1,2857 @@ + [ + 'application/json', + ], + 'createOrchestration' => [ + 'application/json', + ], + 'deleteOrchestration' => [ + 'application/json', + ], + 'getOrchestration' => [ + 'application/json', + ], + 'listOrchestrationBatches' => [ + 'application/json', + ], + 'listOrchestrations' => [ + 'application/json', + ], + 'pauseOrchestration' => [ + 'application/json', + ], + 'resumeOrchestration' => [ + 'application/json', + ], + 'startOrchestration' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation cancelOrchestration + * + * Cancel Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelOrchestration'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return object + */ + public function cancelOrchestration($organisation, $orchestration_id, string $contentType = self::contentTypes['cancelOrchestration'][0]) + { + list($response) = $this->cancelOrchestrationWithHttpInfo($organisation, $orchestration_id, $contentType); + return $response; + } + + /** + * Operation cancelOrchestrationWithHttpInfo + * + * Cancel Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelOrchestration'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function cancelOrchestrationWithHttpInfo($organisation, $orchestration_id, string $contentType = self::contentTypes['cancelOrchestration'][0]) + { + $request = $this->cancelOrchestrationRequest($organisation, $orchestration_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation cancelOrchestrationAsync + * + * Cancel Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cancelOrchestrationAsync($organisation, $orchestration_id, string $contentType = self::contentTypes['cancelOrchestration'][0]) + { + return $this->cancelOrchestrationAsyncWithHttpInfo($organisation, $orchestration_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation cancelOrchestrationAsyncWithHttpInfo + * + * Cancel Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cancelOrchestrationAsyncWithHttpInfo($organisation, $orchestration_id, string $contentType = self::contentTypes['cancelOrchestration'][0]) + { + $returnType = 'object'; + $request = $this->cancelOrchestrationRequest($organisation, $orchestration_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'cancelOrchestration' + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function cancelOrchestrationRequest($organisation, $orchestration_id, string $contentType = self::contentTypes['cancelOrchestration'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling cancelOrchestration' + ); + } + + // verify the required parameter 'orchestration_id' is set + if ($orchestration_id === null || (is_array($orchestration_id) && count($orchestration_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $orchestration_id when calling cancelOrchestration' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}/cancel'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($orchestration_id !== null) { + $resourcePath = str_replace( + '{' . 'orchestrationId' . '}', + ObjectSerializer::toPathValue($orchestration_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createOrchestration + * + * Create Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param \QuantClient\Model\CreateOrchestrationRequest $create_orchestration_request create_orchestration_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOrchestration'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return object + */ + public function createOrchestration($organisation, $create_orchestration_request, string $contentType = self::contentTypes['createOrchestration'][0]) + { + list($response) = $this->createOrchestrationWithHttpInfo($organisation, $create_orchestration_request, $contentType); + return $response; + } + + /** + * Operation createOrchestrationWithHttpInfo + * + * Create Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param \QuantClient\Model\CreateOrchestrationRequest $create_orchestration_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOrchestration'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function createOrchestrationWithHttpInfo($organisation, $create_orchestration_request, string $contentType = self::contentTypes['createOrchestration'][0]) + { + $request = $this->createOrchestrationRequest($organisation, $create_orchestration_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation createOrchestrationAsync + * + * Create Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param \QuantClient\Model\CreateOrchestrationRequest $create_orchestration_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createOrchestrationAsync($organisation, $create_orchestration_request, string $contentType = self::contentTypes['createOrchestration'][0]) + { + return $this->createOrchestrationAsyncWithHttpInfo($organisation, $create_orchestration_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createOrchestrationAsyncWithHttpInfo + * + * Create Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param \QuantClient\Model\CreateOrchestrationRequest $create_orchestration_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createOrchestrationAsyncWithHttpInfo($organisation, $create_orchestration_request, string $contentType = self::contentTypes['createOrchestration'][0]) + { + $returnType = 'object'; + $request = $this->createOrchestrationRequest($organisation, $create_orchestration_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createOrchestration' + * + * @param string $organisation The organisation machine name (required) + * @param \QuantClient\Model\CreateOrchestrationRequest $create_orchestration_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createOrchestrationRequest($organisation, $create_orchestration_request, string $contentType = self::contentTypes['createOrchestration'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling createOrchestration' + ); + } + + // verify the required parameter 'create_orchestration_request' is set + if ($create_orchestration_request === null || (is_array($create_orchestration_request) && count($create_orchestration_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $create_orchestration_request when calling createOrchestration' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/orchestrations'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($create_orchestration_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_orchestration_request)); + } else { + $httpBody = $create_orchestration_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteOrchestration + * + * Delete Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOrchestration'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function deleteOrchestration($organisation, $orchestration_id, string $contentType = self::contentTypes['deleteOrchestration'][0]) + { + $this->deleteOrchestrationWithHttpInfo($organisation, $orchestration_id, $contentType); + } + + /** + * Operation deleteOrchestrationWithHttpInfo + * + * Delete Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOrchestration'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteOrchestrationWithHttpInfo($organisation, $orchestration_id, string $contentType = self::contentTypes['deleteOrchestration'][0]) + { + $request = $this->deleteOrchestrationRequest($organisation, $orchestration_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation deleteOrchestrationAsync + * + * Delete Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteOrchestrationAsync($organisation, $orchestration_id, string $contentType = self::contentTypes['deleteOrchestration'][0]) + { + return $this->deleteOrchestrationAsyncWithHttpInfo($organisation, $orchestration_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteOrchestrationAsyncWithHttpInfo + * + * Delete Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteOrchestrationAsyncWithHttpInfo($organisation, $orchestration_id, string $contentType = self::contentTypes['deleteOrchestration'][0]) + { + $returnType = ''; + $request = $this->deleteOrchestrationRequest($organisation, $orchestration_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteOrchestration' + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteOrchestrationRequest($organisation, $orchestration_id, string $contentType = self::contentTypes['deleteOrchestration'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling deleteOrchestration' + ); + } + + // verify the required parameter 'orchestration_id' is set + if ($orchestration_id === null || (is_array($orchestration_id) && count($orchestration_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $orchestration_id when calling deleteOrchestration' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($orchestration_id !== null) { + $resourcePath = str_replace( + '{' . 'orchestrationId' . '}', + ObjectSerializer::toPathValue($orchestration_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrchestration + * + * Get Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrchestration'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return object + */ + public function getOrchestration($organisation, $orchestration_id, string $contentType = self::contentTypes['getOrchestration'][0]) + { + list($response) = $this->getOrchestrationWithHttpInfo($organisation, $orchestration_id, $contentType); + return $response; + } + + /** + * Operation getOrchestrationWithHttpInfo + * + * Get Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrchestration'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrchestrationWithHttpInfo($organisation, $orchestration_id, string $contentType = self::contentTypes['getOrchestration'][0]) + { + $request = $this->getOrchestrationRequest($organisation, $orchestration_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getOrchestrationAsync + * + * Get Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrchestrationAsync($organisation, $orchestration_id, string $contentType = self::contentTypes['getOrchestration'][0]) + { + return $this->getOrchestrationAsyncWithHttpInfo($organisation, $orchestration_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrchestrationAsyncWithHttpInfo + * + * Get Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrchestrationAsyncWithHttpInfo($organisation, $orchestration_id, string $contentType = self::contentTypes['getOrchestration'][0]) + { + $returnType = 'object'; + $request = $this->getOrchestrationRequest($organisation, $orchestration_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrchestration' + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrchestrationRequest($organisation, $orchestration_id, string $contentType = self::contentTypes['getOrchestration'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling getOrchestration' + ); + } + + // verify the required parameter 'orchestration_id' is set + if ($orchestration_id === null || (is_array($orchestration_id) && count($orchestration_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $orchestration_id when calling getOrchestration' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($orchestration_id !== null) { + $resourcePath = str_replace( + '{' . 'orchestrationId' . '}', + ObjectSerializer::toPathValue($orchestration_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOrchestrationBatches + * + * List Orchestration Batches + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param int|null $limit Maximum number of batches to return (optional, default to 20) + * @param string|null $cursor Pagination cursor from previous response (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOrchestrationBatches'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\ListOrchestrationBatches200Response + */ + public function listOrchestrationBatches($organisation, $orchestration_id, $limit = 20, $cursor = null, string $contentType = self::contentTypes['listOrchestrationBatches'][0]) + { + list($response) = $this->listOrchestrationBatchesWithHttpInfo($organisation, $orchestration_id, $limit, $cursor, $contentType); + return $response; + } + + /** + * Operation listOrchestrationBatchesWithHttpInfo + * + * List Orchestration Batches + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param int|null $limit Maximum number of batches to return (optional, default to 20) + * @param string|null $cursor Pagination cursor from previous response (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOrchestrationBatches'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\ListOrchestrationBatches200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listOrchestrationBatchesWithHttpInfo($organisation, $orchestration_id, $limit = 20, $cursor = null, string $contentType = self::contentTypes['listOrchestrationBatches'][0]) + { + $request = $this->listOrchestrationBatchesRequest($organisation, $orchestration_id, $limit, $cursor, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\ListOrchestrationBatches200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\ListOrchestrationBatches200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\ListOrchestrationBatches200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation listOrchestrationBatchesAsync + * + * List Orchestration Batches + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param int|null $limit Maximum number of batches to return (optional, default to 20) + * @param string|null $cursor Pagination cursor from previous response (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOrchestrationBatches'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOrchestrationBatchesAsync($organisation, $orchestration_id, $limit = 20, $cursor = null, string $contentType = self::contentTypes['listOrchestrationBatches'][0]) + { + return $this->listOrchestrationBatchesAsyncWithHttpInfo($organisation, $orchestration_id, $limit, $cursor, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOrchestrationBatchesAsyncWithHttpInfo + * + * List Orchestration Batches + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param int|null $limit Maximum number of batches to return (optional, default to 20) + * @param string|null $cursor Pagination cursor from previous response (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOrchestrationBatches'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOrchestrationBatchesAsyncWithHttpInfo($organisation, $orchestration_id, $limit = 20, $cursor = null, string $contentType = self::contentTypes['listOrchestrationBatches'][0]) + { + $returnType = '\QuantClient\Model\ListOrchestrationBatches200Response'; + $request = $this->listOrchestrationBatchesRequest($organisation, $orchestration_id, $limit, $cursor, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOrchestrationBatches' + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param int|null $limit Maximum number of batches to return (optional, default to 20) + * @param string|null $cursor Pagination cursor from previous response (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOrchestrationBatches'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listOrchestrationBatchesRequest($organisation, $orchestration_id, $limit = 20, $cursor = null, string $contentType = self::contentTypes['listOrchestrationBatches'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling listOrchestrationBatches' + ); + } + + // verify the required parameter 'orchestration_id' is set + if ($orchestration_id === null || (is_array($orchestration_id) && count($orchestration_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $orchestration_id when calling listOrchestrationBatches' + ); + } + + if ($limit !== null && $limit > 100) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling AIOrchestrationsApi.listOrchestrationBatches, must be smaller than or equal to 100.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling AIOrchestrationsApi.listOrchestrationBatches, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}/batches'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cursor, + 'cursor', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($orchestration_id !== null) { + $resourcePath = str_replace( + '{' . 'orchestrationId' . '}', + ObjectSerializer::toPathValue($orchestration_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listOrchestrations + * + * List Durable Orchestrations + * + * @param string $organisation The organisation machine name (required) + * @param string|null $status Filter by orchestration status (optional) + * @param int|null $limit Maximum number of results (optional, default to 20) + * @param string|null $cursor Pagination cursor from previous response (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOrchestrations'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\ListOrchestrations200Response + */ + public function listOrchestrations($organisation, $status = null, $limit = 20, $cursor = null, string $contentType = self::contentTypes['listOrchestrations'][0]) + { + list($response) = $this->listOrchestrationsWithHttpInfo($organisation, $status, $limit, $cursor, $contentType); + return $response; + } + + /** + * Operation listOrchestrationsWithHttpInfo + * + * List Durable Orchestrations + * + * @param string $organisation The organisation machine name (required) + * @param string|null $status Filter by orchestration status (optional) + * @param int|null $limit Maximum number of results (optional, default to 20) + * @param string|null $cursor Pagination cursor from previous response (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOrchestrations'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\ListOrchestrations200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listOrchestrationsWithHttpInfo($organisation, $status = null, $limit = 20, $cursor = null, string $contentType = self::contentTypes['listOrchestrations'][0]) + { + $request = $this->listOrchestrationsRequest($organisation, $status, $limit, $cursor, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\ListOrchestrations200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\ListOrchestrations200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\ListOrchestrations200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation listOrchestrationsAsync + * + * List Durable Orchestrations + * + * @param string $organisation The organisation machine name (required) + * @param string|null $status Filter by orchestration status (optional) + * @param int|null $limit Maximum number of results (optional, default to 20) + * @param string|null $cursor Pagination cursor from previous response (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOrchestrations'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOrchestrationsAsync($organisation, $status = null, $limit = 20, $cursor = null, string $contentType = self::contentTypes['listOrchestrations'][0]) + { + return $this->listOrchestrationsAsyncWithHttpInfo($organisation, $status, $limit, $cursor, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listOrchestrationsAsyncWithHttpInfo + * + * List Durable Orchestrations + * + * @param string $organisation The organisation machine name (required) + * @param string|null $status Filter by orchestration status (optional) + * @param int|null $limit Maximum number of results (optional, default to 20) + * @param string|null $cursor Pagination cursor from previous response (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOrchestrations'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listOrchestrationsAsyncWithHttpInfo($organisation, $status = null, $limit = 20, $cursor = null, string $contentType = self::contentTypes['listOrchestrations'][0]) + { + $returnType = '\QuantClient\Model\ListOrchestrations200Response'; + $request = $this->listOrchestrationsRequest($organisation, $status, $limit, $cursor, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listOrchestrations' + * + * @param string $organisation The organisation machine name (required) + * @param string|null $status Filter by orchestration status (optional) + * @param int|null $limit Maximum number of results (optional, default to 20) + * @param string|null $cursor Pagination cursor from previous response (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOrchestrations'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listOrchestrationsRequest($organisation, $status = null, $limit = 20, $cursor = null, string $contentType = self::contentTypes['listOrchestrations'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling listOrchestrations' + ); + } + + + if ($limit !== null && $limit > 100) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling AIOrchestrationsApi.listOrchestrations, must be smaller than or equal to 100.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling AIOrchestrationsApi.listOrchestrations, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/orchestrations'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cursor, + 'cursor', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pauseOrchestration + * + * Pause Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pauseOrchestration'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return object + */ + public function pauseOrchestration($organisation, $orchestration_id, string $contentType = self::contentTypes['pauseOrchestration'][0]) + { + list($response) = $this->pauseOrchestrationWithHttpInfo($organisation, $orchestration_id, $contentType); + return $response; + } + + /** + * Operation pauseOrchestrationWithHttpInfo + * + * Pause Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pauseOrchestration'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function pauseOrchestrationWithHttpInfo($organisation, $orchestration_id, string $contentType = self::contentTypes['pauseOrchestration'][0]) + { + $request = $this->pauseOrchestrationRequest($organisation, $orchestration_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation pauseOrchestrationAsync + * + * Pause Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pauseOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function pauseOrchestrationAsync($organisation, $orchestration_id, string $contentType = self::contentTypes['pauseOrchestration'][0]) + { + return $this->pauseOrchestrationAsyncWithHttpInfo($organisation, $orchestration_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pauseOrchestrationAsyncWithHttpInfo + * + * Pause Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pauseOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function pauseOrchestrationAsyncWithHttpInfo($organisation, $orchestration_id, string $contentType = self::contentTypes['pauseOrchestration'][0]) + { + $returnType = 'object'; + $request = $this->pauseOrchestrationRequest($organisation, $orchestration_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pauseOrchestration' + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['pauseOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pauseOrchestrationRequest($organisation, $orchestration_id, string $contentType = self::contentTypes['pauseOrchestration'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling pauseOrchestration' + ); + } + + // verify the required parameter 'orchestration_id' is set + if ($orchestration_id === null || (is_array($orchestration_id) && count($orchestration_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $orchestration_id when calling pauseOrchestration' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}/pause'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($orchestration_id !== null) { + $resourcePath = str_replace( + '{' . 'orchestrationId' . '}', + ObjectSerializer::toPathValue($orchestration_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation resumeOrchestration + * + * Resume Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeOrchestration'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return object + */ + public function resumeOrchestration($organisation, $orchestration_id, string $contentType = self::contentTypes['resumeOrchestration'][0]) + { + list($response) = $this->resumeOrchestrationWithHttpInfo($organisation, $orchestration_id, $contentType); + return $response; + } + + /** + * Operation resumeOrchestrationWithHttpInfo + * + * Resume Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeOrchestration'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function resumeOrchestrationWithHttpInfo($organisation, $orchestration_id, string $contentType = self::contentTypes['resumeOrchestration'][0]) + { + $request = $this->resumeOrchestrationRequest($organisation, $orchestration_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation resumeOrchestrationAsync + * + * Resume Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function resumeOrchestrationAsync($organisation, $orchestration_id, string $contentType = self::contentTypes['resumeOrchestration'][0]) + { + return $this->resumeOrchestrationAsyncWithHttpInfo($organisation, $orchestration_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation resumeOrchestrationAsyncWithHttpInfo + * + * Resume Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function resumeOrchestrationAsyncWithHttpInfo($organisation, $orchestration_id, string $contentType = self::contentTypes['resumeOrchestration'][0]) + { + $returnType = 'object'; + $request = $this->resumeOrchestrationRequest($organisation, $orchestration_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'resumeOrchestration' + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function resumeOrchestrationRequest($organisation, $orchestration_id, string $contentType = self::contentTypes['resumeOrchestration'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling resumeOrchestration' + ); + } + + // verify the required parameter 'orchestration_id' is set + if ($orchestration_id === null || (is_array($orchestration_id) && count($orchestration_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $orchestration_id when calling resumeOrchestration' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}/resume'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($orchestration_id !== null) { + $resourcePath = str_replace( + '{' . 'orchestrationId' . '}', + ObjectSerializer::toPathValue($orchestration_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation startOrchestration + * + * Start Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['startOrchestration'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return object + */ + public function startOrchestration($organisation, $orchestration_id, string $contentType = self::contentTypes['startOrchestration'][0]) + { + list($response) = $this->startOrchestrationWithHttpInfo($organisation, $orchestration_id, $contentType); + return $response; + } + + /** + * Operation startOrchestrationWithHttpInfo + * + * Start Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['startOrchestration'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function startOrchestrationWithHttpInfo($organisation, $orchestration_id, string $contentType = self::contentTypes['startOrchestration'][0]) + { + $request = $this->startOrchestrationRequest($organisation, $orchestration_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + 'object', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation startOrchestrationAsync + * + * Start Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['startOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function startOrchestrationAsync($organisation, $orchestration_id, string $contentType = self::contentTypes['startOrchestration'][0]) + { + return $this->startOrchestrationAsyncWithHttpInfo($organisation, $orchestration_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation startOrchestrationAsyncWithHttpInfo + * + * Start Durable Orchestration + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['startOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function startOrchestrationAsyncWithHttpInfo($organisation, $orchestration_id, string $contentType = self::contentTypes['startOrchestration'][0]) + { + $returnType = 'object'; + $request = $this->startOrchestrationRequest($organisation, $orchestration_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'startOrchestration' + * + * @param string $organisation The organisation machine name (required) + * @param string $orchestration_id Orchestration identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['startOrchestration'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function startOrchestrationRequest($organisation, $orchestration_id, string $contentType = self::contentTypes['startOrchestration'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling startOrchestration' + ); + } + + // verify the required parameter 'orchestration_id' is set + if ($orchestration_id === null || (is_array($orchestration_id) && count($orchestration_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $orchestration_id when calling startOrchestration' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/orchestrations/{orchestrationId}/start'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($orchestration_id !== null) { + $resourcePath = str_replace( + '{' . 'orchestrationId' . '}', + ObjectSerializer::toPathValue($orchestration_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/src/Api/AISearchApi.php b/src/Api/AISearchApi.php new file mode 100644 index 00000000..203577e8 --- /dev/null +++ b/src/Api/AISearchApi.php @@ -0,0 +1,4677 @@ + [ + 'application/json', + ], + 'aiSearchDeletePages' => [ + 'application/json', + ], + 'aiSearchDisable' => [ + 'application/json', + ], + 'aiSearchEnable' => [ + 'application/json', + ], + 'aiSearchGetCrawl' => [ + 'application/json', + ], + 'aiSearchGetCrawlPages' => [ + 'application/json', + ], + 'aiSearchGetSettings' => [ + 'application/json', + ], + 'aiSearchIngestPages' => [ + 'application/json', + ], + 'aiSearchListCrawls' => [ + 'application/json', + ], + 'aiSearchListPages' => [ + 'application/json', + ], + 'aiSearchPurgeIndex' => [ + 'application/json', + ], + 'aiSearchSearch' => [ + 'application/json', + ], + 'aiSearchStatus' => [ + 'application/json', + ], + 'aiSearchTopQueries' => [ + 'application/json', + ], + 'aiSearchTriggerCrawl' => [ + 'application/json', + ], + 'aiSearchUpdateSettings' => [ + 'application/json', + ], + 'aiSearchUsage' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation aiSearchChat + * + * RAG chat with AI Search content + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param \QuantClient\Model\AiSearchChatRequest $ai_search_chat_request ai_search_chat_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchChat'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchChat($organisation, $project, $ai_search_chat_request, string $contentType = self::contentTypes['aiSearchChat'][0]) + { + $this->aiSearchChatWithHttpInfo($organisation, $project, $ai_search_chat_request, $contentType); + } + + /** + * Operation aiSearchChatWithHttpInfo + * + * RAG chat with AI Search content + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchChatRequest $ai_search_chat_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchChat'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchChatWithHttpInfo($organisation, $project, $ai_search_chat_request, string $contentType = self::contentTypes['aiSearchChat'][0]) + { + $request = $this->aiSearchChatRequest($organisation, $project, $ai_search_chat_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchChatAsync + * + * RAG chat with AI Search content + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchChatRequest $ai_search_chat_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchChat'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchChatAsync($organisation, $project, $ai_search_chat_request, string $contentType = self::contentTypes['aiSearchChat'][0]) + { + return $this->aiSearchChatAsyncWithHttpInfo($organisation, $project, $ai_search_chat_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchChatAsyncWithHttpInfo + * + * RAG chat with AI Search content + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchChatRequest $ai_search_chat_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchChat'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchChatAsyncWithHttpInfo($organisation, $project, $ai_search_chat_request, string $contentType = self::contentTypes['aiSearchChat'][0]) + { + $returnType = ''; + $request = $this->aiSearchChatRequest($organisation, $project, $ai_search_chat_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchChat' + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchChatRequest $ai_search_chat_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchChat'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchChatRequest($organisation, $project, $ai_search_chat_request, string $contentType = self::contentTypes['aiSearchChat'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchChat' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchChat' + ); + } + + // verify the required parameter 'ai_search_chat_request' is set + if ($ai_search_chat_request === null || (is_array($ai_search_chat_request) && count($ai_search_chat_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ai_search_chat_request when calling aiSearchChat' + ); + } + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/chat'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($ai_search_chat_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($ai_search_chat_request)); + } else { + $httpBody = $ai_search_chat_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchDeletePages + * + * Delete pages by URLs or patterns + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param \QuantClient\Model\AiSearchDeletePagesRequest $ai_search_delete_pages_request ai_search_delete_pages_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchDeletePages'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchDeletePages($organisation, $project, $ai_search_delete_pages_request, string $contentType = self::contentTypes['aiSearchDeletePages'][0]) + { + $this->aiSearchDeletePagesWithHttpInfo($organisation, $project, $ai_search_delete_pages_request, $contentType); + } + + /** + * Operation aiSearchDeletePagesWithHttpInfo + * + * Delete pages by URLs or patterns + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchDeletePagesRequest $ai_search_delete_pages_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchDeletePages'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchDeletePagesWithHttpInfo($organisation, $project, $ai_search_delete_pages_request, string $contentType = self::contentTypes['aiSearchDeletePages'][0]) + { + $request = $this->aiSearchDeletePagesRequest($organisation, $project, $ai_search_delete_pages_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchDeletePagesAsync + * + * Delete pages by URLs or patterns + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchDeletePagesRequest $ai_search_delete_pages_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchDeletePages'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchDeletePagesAsync($organisation, $project, $ai_search_delete_pages_request, string $contentType = self::contentTypes['aiSearchDeletePages'][0]) + { + return $this->aiSearchDeletePagesAsyncWithHttpInfo($organisation, $project, $ai_search_delete_pages_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchDeletePagesAsyncWithHttpInfo + * + * Delete pages by URLs or patterns + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchDeletePagesRequest $ai_search_delete_pages_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchDeletePages'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchDeletePagesAsyncWithHttpInfo($organisation, $project, $ai_search_delete_pages_request, string $contentType = self::contentTypes['aiSearchDeletePages'][0]) + { + $returnType = ''; + $request = $this->aiSearchDeletePagesRequest($organisation, $project, $ai_search_delete_pages_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchDeletePages' + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchDeletePagesRequest $ai_search_delete_pages_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchDeletePages'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchDeletePagesRequest($organisation, $project, $ai_search_delete_pages_request, string $contentType = self::contentTypes['aiSearchDeletePages'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchDeletePages' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchDeletePages' + ); + } + + // verify the required parameter 'ai_search_delete_pages_request' is set + if ($ai_search_delete_pages_request === null || (is_array($ai_search_delete_pages_request) && count($ai_search_delete_pages_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ai_search_delete_pages_request when calling aiSearchDeletePages' + ); + } + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/pages'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($ai_search_delete_pages_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($ai_search_delete_pages_request)); + } else { + $httpBody = $ai_search_delete_pages_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchDisable + * + * Disable AI Search for a project + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchDisable'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchDisable($organisation, $project, string $contentType = self::contentTypes['aiSearchDisable'][0]) + { + $this->aiSearchDisableWithHttpInfo($organisation, $project, $contentType); + } + + /** + * Operation aiSearchDisableWithHttpInfo + * + * Disable AI Search for a project + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchDisable'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchDisableWithHttpInfo($organisation, $project, string $contentType = self::contentTypes['aiSearchDisable'][0]) + { + $request = $this->aiSearchDisableRequest($organisation, $project, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchDisableAsync + * + * Disable AI Search for a project + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchDisable'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchDisableAsync($organisation, $project, string $contentType = self::contentTypes['aiSearchDisable'][0]) + { + return $this->aiSearchDisableAsyncWithHttpInfo($organisation, $project, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchDisableAsyncWithHttpInfo + * + * Disable AI Search for a project + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchDisable'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchDisableAsyncWithHttpInfo($organisation, $project, string $contentType = self::contentTypes['aiSearchDisable'][0]) + { + $returnType = ''; + $request = $this->aiSearchDisableRequest($organisation, $project, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchDisable' + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchDisable'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchDisableRequest($organisation, $project, string $contentType = self::contentTypes['aiSearchDisable'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchDisable' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchDisable' + ); + } + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/disable'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchEnable + * + * Enable AI Search for a project + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param \QuantClient\Model\AiSearchEnableRequest|null $ai_search_enable_request ai_search_enable_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchEnable'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchEnable($organisation, $project, $ai_search_enable_request = null, string $contentType = self::contentTypes['aiSearchEnable'][0]) + { + $this->aiSearchEnableWithHttpInfo($organisation, $project, $ai_search_enable_request, $contentType); + } + + /** + * Operation aiSearchEnableWithHttpInfo + * + * Enable AI Search for a project + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchEnableRequest|null $ai_search_enable_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchEnable'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchEnableWithHttpInfo($organisation, $project, $ai_search_enable_request = null, string $contentType = self::contentTypes['aiSearchEnable'][0]) + { + $request = $this->aiSearchEnableRequest($organisation, $project, $ai_search_enable_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchEnableAsync + * + * Enable AI Search for a project + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchEnableRequest|null $ai_search_enable_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchEnable'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchEnableAsync($organisation, $project, $ai_search_enable_request = null, string $contentType = self::contentTypes['aiSearchEnable'][0]) + { + return $this->aiSearchEnableAsyncWithHttpInfo($organisation, $project, $ai_search_enable_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchEnableAsyncWithHttpInfo + * + * Enable AI Search for a project + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchEnableRequest|null $ai_search_enable_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchEnable'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchEnableAsyncWithHttpInfo($organisation, $project, $ai_search_enable_request = null, string $contentType = self::contentTypes['aiSearchEnable'][0]) + { + $returnType = ''; + $request = $this->aiSearchEnableRequest($organisation, $project, $ai_search_enable_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchEnable' + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchEnableRequest|null $ai_search_enable_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchEnable'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchEnableRequest($organisation, $project, $ai_search_enable_request = null, string $contentType = self::contentTypes['aiSearchEnable'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchEnable' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchEnable' + ); + } + + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/enable'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($ai_search_enable_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($ai_search_enable_request)); + } else { + $httpBody = $ai_search_enable_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchGetCrawl + * + * Get AI Search ingest job status + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param string $job_id job_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchGetCrawl'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchGetCrawl($organisation, $project, $job_id, string $contentType = self::contentTypes['aiSearchGetCrawl'][0]) + { + $this->aiSearchGetCrawlWithHttpInfo($organisation, $project, $job_id, $contentType); + } + + /** + * Operation aiSearchGetCrawlWithHttpInfo + * + * Get AI Search ingest job status + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $job_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchGetCrawl'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchGetCrawlWithHttpInfo($organisation, $project, $job_id, string $contentType = self::contentTypes['aiSearchGetCrawl'][0]) + { + $request = $this->aiSearchGetCrawlRequest($organisation, $project, $job_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchGetCrawlAsync + * + * Get AI Search ingest job status + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $job_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchGetCrawl'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchGetCrawlAsync($organisation, $project, $job_id, string $contentType = self::contentTypes['aiSearchGetCrawl'][0]) + { + return $this->aiSearchGetCrawlAsyncWithHttpInfo($organisation, $project, $job_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchGetCrawlAsyncWithHttpInfo + * + * Get AI Search ingest job status + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $job_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchGetCrawl'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchGetCrawlAsyncWithHttpInfo($organisation, $project, $job_id, string $contentType = self::contentTypes['aiSearchGetCrawl'][0]) + { + $returnType = ''; + $request = $this->aiSearchGetCrawlRequest($organisation, $project, $job_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchGetCrawl' + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $job_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchGetCrawl'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchGetCrawlRequest($organisation, $project, $job_id, string $contentType = self::contentTypes['aiSearchGetCrawl'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchGetCrawl' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchGetCrawl' + ); + } + + // verify the required parameter 'job_id' is set + if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $job_id when calling aiSearchGetCrawl' + ); + } + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/crawls/{jobId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + // path params + if ($job_id !== null) { + $resourcePath = str_replace( + '{' . 'jobId' . '}', + ObjectSerializer::toPathValue($job_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchGetCrawlPages + * + * Get per-page ingest results for a crawl job + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param string $job_id job_id (required) + * @param int|null $limit limit (optional) + * @param int|null $status_code status_code (optional) + * @param string|null $processing_status processing_status (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchGetCrawlPages'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchGetCrawlPages($organisation, $project, $job_id, $limit = null, $status_code = null, $processing_status = null, string $contentType = self::contentTypes['aiSearchGetCrawlPages'][0]) + { + $this->aiSearchGetCrawlPagesWithHttpInfo($organisation, $project, $job_id, $limit, $status_code, $processing_status, $contentType); + } + + /** + * Operation aiSearchGetCrawlPagesWithHttpInfo + * + * Get per-page ingest results for a crawl job + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $job_id (required) + * @param int|null $limit (optional) + * @param int|null $status_code (optional) + * @param string|null $processing_status (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchGetCrawlPages'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchGetCrawlPagesWithHttpInfo($organisation, $project, $job_id, $limit = null, $status_code = null, $processing_status = null, string $contentType = self::contentTypes['aiSearchGetCrawlPages'][0]) + { + $request = $this->aiSearchGetCrawlPagesRequest($organisation, $project, $job_id, $limit, $status_code, $processing_status, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchGetCrawlPagesAsync + * + * Get per-page ingest results for a crawl job + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $job_id (required) + * @param int|null $limit (optional) + * @param int|null $status_code (optional) + * @param string|null $processing_status (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchGetCrawlPages'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchGetCrawlPagesAsync($organisation, $project, $job_id, $limit = null, $status_code = null, $processing_status = null, string $contentType = self::contentTypes['aiSearchGetCrawlPages'][0]) + { + return $this->aiSearchGetCrawlPagesAsyncWithHttpInfo($organisation, $project, $job_id, $limit, $status_code, $processing_status, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchGetCrawlPagesAsyncWithHttpInfo + * + * Get per-page ingest results for a crawl job + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $job_id (required) + * @param int|null $limit (optional) + * @param int|null $status_code (optional) + * @param string|null $processing_status (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchGetCrawlPages'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchGetCrawlPagesAsyncWithHttpInfo($organisation, $project, $job_id, $limit = null, $status_code = null, $processing_status = null, string $contentType = self::contentTypes['aiSearchGetCrawlPages'][0]) + { + $returnType = ''; + $request = $this->aiSearchGetCrawlPagesRequest($organisation, $project, $job_id, $limit, $status_code, $processing_status, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchGetCrawlPages' + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $job_id (required) + * @param int|null $limit (optional) + * @param int|null $status_code (optional) + * @param string|null $processing_status (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchGetCrawlPages'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchGetCrawlPagesRequest($organisation, $project, $job_id, $limit = null, $status_code = null, $processing_status = null, string $contentType = self::contentTypes['aiSearchGetCrawlPages'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchGetCrawlPages' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchGetCrawlPages' + ); + } + + // verify the required parameter 'job_id' is set + if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $job_id when calling aiSearchGetCrawlPages' + ); + } + + + + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/crawls/{jobId}/pages'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status_code, + 'statusCode', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $processing_status, + 'processingStatus', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + // path params + if ($job_id !== null) { + $resourcePath = str_replace( + '{' . 'jobId' . '}', + ObjectSerializer::toPathValue($job_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchGetSettings + * + * Get AI Search public access and rate limit settings + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchGetSettings'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchGetSettings($organisation, $project, string $contentType = self::contentTypes['aiSearchGetSettings'][0]) + { + $this->aiSearchGetSettingsWithHttpInfo($organisation, $project, $contentType); + } + + /** + * Operation aiSearchGetSettingsWithHttpInfo + * + * Get AI Search public access and rate limit settings + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchGetSettings'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchGetSettingsWithHttpInfo($organisation, $project, string $contentType = self::contentTypes['aiSearchGetSettings'][0]) + { + $request = $this->aiSearchGetSettingsRequest($organisation, $project, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchGetSettingsAsync + * + * Get AI Search public access and rate limit settings + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchGetSettings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchGetSettingsAsync($organisation, $project, string $contentType = self::contentTypes['aiSearchGetSettings'][0]) + { + return $this->aiSearchGetSettingsAsyncWithHttpInfo($organisation, $project, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchGetSettingsAsyncWithHttpInfo + * + * Get AI Search public access and rate limit settings + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchGetSettings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchGetSettingsAsyncWithHttpInfo($organisation, $project, string $contentType = self::contentTypes['aiSearchGetSettings'][0]) + { + $returnType = ''; + $request = $this->aiSearchGetSettingsRequest($organisation, $project, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchGetSettings' + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchGetSettings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchGetSettingsRequest($organisation, $project, string $contentType = self::contentTypes['aiSearchGetSettings'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchGetSettings' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchGetSettings' + ); + } + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchIngestPages + * + * Ingest pages into the AI Search index + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param \QuantClient\Model\AiSearchIngestPagesRequest $ai_search_ingest_pages_request ai_search_ingest_pages_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchIngestPages'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchIngestPages($organisation, $project, $ai_search_ingest_pages_request, string $contentType = self::contentTypes['aiSearchIngestPages'][0]) + { + $this->aiSearchIngestPagesWithHttpInfo($organisation, $project, $ai_search_ingest_pages_request, $contentType); + } + + /** + * Operation aiSearchIngestPagesWithHttpInfo + * + * Ingest pages into the AI Search index + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchIngestPagesRequest $ai_search_ingest_pages_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchIngestPages'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchIngestPagesWithHttpInfo($organisation, $project, $ai_search_ingest_pages_request, string $contentType = self::contentTypes['aiSearchIngestPages'][0]) + { + $request = $this->aiSearchIngestPagesRequest($organisation, $project, $ai_search_ingest_pages_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchIngestPagesAsync + * + * Ingest pages into the AI Search index + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchIngestPagesRequest $ai_search_ingest_pages_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchIngestPages'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchIngestPagesAsync($organisation, $project, $ai_search_ingest_pages_request, string $contentType = self::contentTypes['aiSearchIngestPages'][0]) + { + return $this->aiSearchIngestPagesAsyncWithHttpInfo($organisation, $project, $ai_search_ingest_pages_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchIngestPagesAsyncWithHttpInfo + * + * Ingest pages into the AI Search index + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchIngestPagesRequest $ai_search_ingest_pages_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchIngestPages'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchIngestPagesAsyncWithHttpInfo($organisation, $project, $ai_search_ingest_pages_request, string $contentType = self::contentTypes['aiSearchIngestPages'][0]) + { + $returnType = ''; + $request = $this->aiSearchIngestPagesRequest($organisation, $project, $ai_search_ingest_pages_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchIngestPages' + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchIngestPagesRequest $ai_search_ingest_pages_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchIngestPages'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchIngestPagesRequest($organisation, $project, $ai_search_ingest_pages_request, string $contentType = self::contentTypes['aiSearchIngestPages'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchIngestPages' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchIngestPages' + ); + } + + // verify the required parameter 'ai_search_ingest_pages_request' is set + if ($ai_search_ingest_pages_request === null || (is_array($ai_search_ingest_pages_request) && count($ai_search_ingest_pages_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ai_search_ingest_pages_request when calling aiSearchIngestPages' + ); + } + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/pages'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($ai_search_ingest_pages_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($ai_search_ingest_pages_request)); + } else { + $httpBody = $ai_search_ingest_pages_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchListCrawls + * + * List AI Search ingest jobs + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param int|null $limit limit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchListCrawls'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchListCrawls($organisation, $project, $limit = null, string $contentType = self::contentTypes['aiSearchListCrawls'][0]) + { + $this->aiSearchListCrawlsWithHttpInfo($organisation, $project, $limit, $contentType); + } + + /** + * Operation aiSearchListCrawlsWithHttpInfo + * + * List AI Search ingest jobs + * + * @param string $organisation (required) + * @param string $project (required) + * @param int|null $limit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchListCrawls'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchListCrawlsWithHttpInfo($organisation, $project, $limit = null, string $contentType = self::contentTypes['aiSearchListCrawls'][0]) + { + $request = $this->aiSearchListCrawlsRequest($organisation, $project, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchListCrawlsAsync + * + * List AI Search ingest jobs + * + * @param string $organisation (required) + * @param string $project (required) + * @param int|null $limit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchListCrawls'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchListCrawlsAsync($organisation, $project, $limit = null, string $contentType = self::contentTypes['aiSearchListCrawls'][0]) + { + return $this->aiSearchListCrawlsAsyncWithHttpInfo($organisation, $project, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchListCrawlsAsyncWithHttpInfo + * + * List AI Search ingest jobs + * + * @param string $organisation (required) + * @param string $project (required) + * @param int|null $limit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchListCrawls'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchListCrawlsAsyncWithHttpInfo($organisation, $project, $limit = null, string $contentType = self::contentTypes['aiSearchListCrawls'][0]) + { + $returnType = ''; + $request = $this->aiSearchListCrawlsRequest($organisation, $project, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchListCrawls' + * + * @param string $organisation (required) + * @param string $project (required) + * @param int|null $limit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchListCrawls'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchListCrawlsRequest($organisation, $project, $limit = null, string $contentType = self::contentTypes['aiSearchListCrawls'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchListCrawls' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchListCrawls' + ); + } + + if ($limit !== null && $limit > 50) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling AISearchApi.aiSearchListCrawls, must be smaller than or equal to 50.'); + } + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/crawls'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchListPages + * + * List indexed pages with cursor pagination + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param int|null $limit limit (optional) + * @param string|null $cursor cursor (optional) + * @param string|null $search search (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchListPages'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchListPages($organisation, $project, $limit = null, $cursor = null, $search = null, string $contentType = self::contentTypes['aiSearchListPages'][0]) + { + $this->aiSearchListPagesWithHttpInfo($organisation, $project, $limit, $cursor, $search, $contentType); + } + + /** + * Operation aiSearchListPagesWithHttpInfo + * + * List indexed pages with cursor pagination + * + * @param string $organisation (required) + * @param string $project (required) + * @param int|null $limit (optional) + * @param string|null $cursor (optional) + * @param string|null $search (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchListPages'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchListPagesWithHttpInfo($organisation, $project, $limit = null, $cursor = null, $search = null, string $contentType = self::contentTypes['aiSearchListPages'][0]) + { + $request = $this->aiSearchListPagesRequest($organisation, $project, $limit, $cursor, $search, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchListPagesAsync + * + * List indexed pages with cursor pagination + * + * @param string $organisation (required) + * @param string $project (required) + * @param int|null $limit (optional) + * @param string|null $cursor (optional) + * @param string|null $search (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchListPages'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchListPagesAsync($organisation, $project, $limit = null, $cursor = null, $search = null, string $contentType = self::contentTypes['aiSearchListPages'][0]) + { + return $this->aiSearchListPagesAsyncWithHttpInfo($organisation, $project, $limit, $cursor, $search, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchListPagesAsyncWithHttpInfo + * + * List indexed pages with cursor pagination + * + * @param string $organisation (required) + * @param string $project (required) + * @param int|null $limit (optional) + * @param string|null $cursor (optional) + * @param string|null $search (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchListPages'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchListPagesAsyncWithHttpInfo($organisation, $project, $limit = null, $cursor = null, $search = null, string $contentType = self::contentTypes['aiSearchListPages'][0]) + { + $returnType = ''; + $request = $this->aiSearchListPagesRequest($organisation, $project, $limit, $cursor, $search, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchListPages' + * + * @param string $organisation (required) + * @param string $project (required) + * @param int|null $limit (optional) + * @param string|null $cursor (optional) + * @param string|null $search (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchListPages'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchListPagesRequest($organisation, $project, $limit = null, $cursor = null, $search = null, string $contentType = self::contentTypes['aiSearchListPages'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchListPages' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchListPages' + ); + } + + if ($limit !== null && $limit > 200) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling AISearchApi.aiSearchListPages, must be smaller than or equal to 200.'); + } + + + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/pages'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cursor, + 'cursor', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $search, + 'search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchPurgeIndex + * + * Purge the entire AI Search index + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchPurgeIndex'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchPurgeIndex($organisation, $project, string $contentType = self::contentTypes['aiSearchPurgeIndex'][0]) + { + $this->aiSearchPurgeIndexWithHttpInfo($organisation, $project, $contentType); + } + + /** + * Operation aiSearchPurgeIndexWithHttpInfo + * + * Purge the entire AI Search index + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchPurgeIndex'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchPurgeIndexWithHttpInfo($organisation, $project, string $contentType = self::contentTypes['aiSearchPurgeIndex'][0]) + { + $request = $this->aiSearchPurgeIndexRequest($organisation, $project, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchPurgeIndexAsync + * + * Purge the entire AI Search index + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchPurgeIndex'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchPurgeIndexAsync($organisation, $project, string $contentType = self::contentTypes['aiSearchPurgeIndex'][0]) + { + return $this->aiSearchPurgeIndexAsyncWithHttpInfo($organisation, $project, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchPurgeIndexAsyncWithHttpInfo + * + * Purge the entire AI Search index + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchPurgeIndex'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchPurgeIndexAsyncWithHttpInfo($organisation, $project, string $contentType = self::contentTypes['aiSearchPurgeIndex'][0]) + { + $returnType = ''; + $request = $this->aiSearchPurgeIndexRequest($organisation, $project, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchPurgeIndex' + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchPurgeIndex'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchPurgeIndexRequest($organisation, $project, string $contentType = self::contentTypes['aiSearchPurgeIndex'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchPurgeIndex' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchPurgeIndex' + ); + } + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/index'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchSearch + * + * Semantic search across the AI Search index + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param \QuantClient\Model\AiSearchSearchRequest $ai_search_search_request ai_search_search_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchSearch'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchSearch($organisation, $project, $ai_search_search_request, string $contentType = self::contentTypes['aiSearchSearch'][0]) + { + $this->aiSearchSearchWithHttpInfo($organisation, $project, $ai_search_search_request, $contentType); + } + + /** + * Operation aiSearchSearchWithHttpInfo + * + * Semantic search across the AI Search index + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchSearchRequest $ai_search_search_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchSearch'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchSearchWithHttpInfo($organisation, $project, $ai_search_search_request, string $contentType = self::contentTypes['aiSearchSearch'][0]) + { + $request = $this->aiSearchSearchRequest($organisation, $project, $ai_search_search_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchSearchAsync + * + * Semantic search across the AI Search index + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchSearchRequest $ai_search_search_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchSearch'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchSearchAsync($organisation, $project, $ai_search_search_request, string $contentType = self::contentTypes['aiSearchSearch'][0]) + { + return $this->aiSearchSearchAsyncWithHttpInfo($organisation, $project, $ai_search_search_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchSearchAsyncWithHttpInfo + * + * Semantic search across the AI Search index + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchSearchRequest $ai_search_search_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchSearch'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchSearchAsyncWithHttpInfo($organisation, $project, $ai_search_search_request, string $contentType = self::contentTypes['aiSearchSearch'][0]) + { + $returnType = ''; + $request = $this->aiSearchSearchRequest($organisation, $project, $ai_search_search_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchSearch' + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchSearchRequest $ai_search_search_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchSearch'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchSearchRequest($organisation, $project, $ai_search_search_request, string $contentType = self::contentTypes['aiSearchSearch'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchSearch' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchSearch' + ); + } + + // verify the required parameter 'ai_search_search_request' is set + if ($ai_search_search_request === null || (is_array($ai_search_search_request) && count($ai_search_search_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ai_search_search_request when calling aiSearchSearch' + ); + } + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/search'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($ai_search_search_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($ai_search_search_request)); + } else { + $httpBody = $ai_search_search_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchStatus + * + * Get AI Search status for a project + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchStatus'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchStatus($organisation, $project, string $contentType = self::contentTypes['aiSearchStatus'][0]) + { + $this->aiSearchStatusWithHttpInfo($organisation, $project, $contentType); + } + + /** + * Operation aiSearchStatusWithHttpInfo + * + * Get AI Search status for a project + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchStatus'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchStatusWithHttpInfo($organisation, $project, string $contentType = self::contentTypes['aiSearchStatus'][0]) + { + $request = $this->aiSearchStatusRequest($organisation, $project, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchStatusAsync + * + * Get AI Search status for a project + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchStatusAsync($organisation, $project, string $contentType = self::contentTypes['aiSearchStatus'][0]) + { + return $this->aiSearchStatusAsyncWithHttpInfo($organisation, $project, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchStatusAsyncWithHttpInfo + * + * Get AI Search status for a project + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchStatusAsyncWithHttpInfo($organisation, $project, string $contentType = self::contentTypes['aiSearchStatus'][0]) + { + $returnType = ''; + $request = $this->aiSearchStatusRequest($organisation, $project, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchStatus' + * + * @param string $organisation (required) + * @param string $project (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchStatusRequest($organisation, $project, string $contentType = self::contentTypes['aiSearchStatus'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchStatus' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchStatus' + ); + } + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchTopQueries + * + * Get the most popular AI Search queries + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param string|null $range range (optional, default to '30d') + * @param int|null $limit limit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchTopQueries'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchTopQueries($organisation, $project, $range = '30d', $limit = null, string $contentType = self::contentTypes['aiSearchTopQueries'][0]) + { + $this->aiSearchTopQueriesWithHttpInfo($organisation, $project, $range, $limit, $contentType); + } + + /** + * Operation aiSearchTopQueriesWithHttpInfo + * + * Get the most popular AI Search queries + * + * @param string $organisation (required) + * @param string $project (required) + * @param string|null $range (optional, default to '30d') + * @param int|null $limit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchTopQueries'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchTopQueriesWithHttpInfo($organisation, $project, $range = '30d', $limit = null, string $contentType = self::contentTypes['aiSearchTopQueries'][0]) + { + $request = $this->aiSearchTopQueriesRequest($organisation, $project, $range, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchTopQueriesAsync + * + * Get the most popular AI Search queries + * + * @param string $organisation (required) + * @param string $project (required) + * @param string|null $range (optional, default to '30d') + * @param int|null $limit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchTopQueries'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchTopQueriesAsync($organisation, $project, $range = '30d', $limit = null, string $contentType = self::contentTypes['aiSearchTopQueries'][0]) + { + return $this->aiSearchTopQueriesAsyncWithHttpInfo($organisation, $project, $range, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchTopQueriesAsyncWithHttpInfo + * + * Get the most popular AI Search queries + * + * @param string $organisation (required) + * @param string $project (required) + * @param string|null $range (optional, default to '30d') + * @param int|null $limit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchTopQueries'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchTopQueriesAsyncWithHttpInfo($organisation, $project, $range = '30d', $limit = null, string $contentType = self::contentTypes['aiSearchTopQueries'][0]) + { + $returnType = ''; + $request = $this->aiSearchTopQueriesRequest($organisation, $project, $range, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchTopQueries' + * + * @param string $organisation (required) + * @param string $project (required) + * @param string|null $range (optional, default to '30d') + * @param int|null $limit (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchTopQueries'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchTopQueriesRequest($organisation, $project, $range = '30d', $limit = null, string $contentType = self::contentTypes['aiSearchTopQueries'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchTopQueries' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchTopQueries' + ); + } + + + if ($limit !== null && $limit > 100) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling AISearchApi.aiSearchTopQueries, must be smaller than or equal to 100.'); + } + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/top-queries'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $range, + 'range', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchTriggerCrawl + * + * Trigger a crawler run that ingests into AI Search + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param \QuantClient\Model\AiSearchTriggerCrawlRequest $ai_search_trigger_crawl_request ai_search_trigger_crawl_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchTriggerCrawl'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchTriggerCrawl($organisation, $project, $ai_search_trigger_crawl_request, string $contentType = self::contentTypes['aiSearchTriggerCrawl'][0]) + { + $this->aiSearchTriggerCrawlWithHttpInfo($organisation, $project, $ai_search_trigger_crawl_request, $contentType); + } + + /** + * Operation aiSearchTriggerCrawlWithHttpInfo + * + * Trigger a crawler run that ingests into AI Search + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchTriggerCrawlRequest $ai_search_trigger_crawl_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchTriggerCrawl'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchTriggerCrawlWithHttpInfo($organisation, $project, $ai_search_trigger_crawl_request, string $contentType = self::contentTypes['aiSearchTriggerCrawl'][0]) + { + $request = $this->aiSearchTriggerCrawlRequest($organisation, $project, $ai_search_trigger_crawl_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchTriggerCrawlAsync + * + * Trigger a crawler run that ingests into AI Search + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchTriggerCrawlRequest $ai_search_trigger_crawl_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchTriggerCrawl'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchTriggerCrawlAsync($organisation, $project, $ai_search_trigger_crawl_request, string $contentType = self::contentTypes['aiSearchTriggerCrawl'][0]) + { + return $this->aiSearchTriggerCrawlAsyncWithHttpInfo($organisation, $project, $ai_search_trigger_crawl_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchTriggerCrawlAsyncWithHttpInfo + * + * Trigger a crawler run that ingests into AI Search + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchTriggerCrawlRequest $ai_search_trigger_crawl_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchTriggerCrawl'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchTriggerCrawlAsyncWithHttpInfo($organisation, $project, $ai_search_trigger_crawl_request, string $contentType = self::contentTypes['aiSearchTriggerCrawl'][0]) + { + $returnType = ''; + $request = $this->aiSearchTriggerCrawlRequest($organisation, $project, $ai_search_trigger_crawl_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchTriggerCrawl' + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchTriggerCrawlRequest $ai_search_trigger_crawl_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchTriggerCrawl'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchTriggerCrawlRequest($organisation, $project, $ai_search_trigger_crawl_request, string $contentType = self::contentTypes['aiSearchTriggerCrawl'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchTriggerCrawl' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchTriggerCrawl' + ); + } + + // verify the required parameter 'ai_search_trigger_crawl_request' is set + if ($ai_search_trigger_crawl_request === null || (is_array($ai_search_trigger_crawl_request) && count($ai_search_trigger_crawl_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ai_search_trigger_crawl_request when calling aiSearchTriggerCrawl' + ); + } + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/crawls'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($ai_search_trigger_crawl_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($ai_search_trigger_crawl_request)); + } else { + $httpBody = $ai_search_trigger_crawl_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchUpdateSettings + * + * Update AI Search public access and rate limit settings + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param \QuantClient\Model\AiSearchUpdateSettingsRequest $ai_search_update_settings_request ai_search_update_settings_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchUpdateSettings'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchUpdateSettings($organisation, $project, $ai_search_update_settings_request, string $contentType = self::contentTypes['aiSearchUpdateSettings'][0]) + { + $this->aiSearchUpdateSettingsWithHttpInfo($organisation, $project, $ai_search_update_settings_request, $contentType); + } + + /** + * Operation aiSearchUpdateSettingsWithHttpInfo + * + * Update AI Search public access and rate limit settings + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchUpdateSettingsRequest $ai_search_update_settings_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchUpdateSettings'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchUpdateSettingsWithHttpInfo($organisation, $project, $ai_search_update_settings_request, string $contentType = self::contentTypes['aiSearchUpdateSettings'][0]) + { + $request = $this->aiSearchUpdateSettingsRequest($organisation, $project, $ai_search_update_settings_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchUpdateSettingsAsync + * + * Update AI Search public access and rate limit settings + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchUpdateSettingsRequest $ai_search_update_settings_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchUpdateSettings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchUpdateSettingsAsync($organisation, $project, $ai_search_update_settings_request, string $contentType = self::contentTypes['aiSearchUpdateSettings'][0]) + { + return $this->aiSearchUpdateSettingsAsyncWithHttpInfo($organisation, $project, $ai_search_update_settings_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchUpdateSettingsAsyncWithHttpInfo + * + * Update AI Search public access and rate limit settings + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchUpdateSettingsRequest $ai_search_update_settings_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchUpdateSettings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchUpdateSettingsAsyncWithHttpInfo($organisation, $project, $ai_search_update_settings_request, string $contentType = self::contentTypes['aiSearchUpdateSettings'][0]) + { + $returnType = ''; + $request = $this->aiSearchUpdateSettingsRequest($organisation, $project, $ai_search_update_settings_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchUpdateSettings' + * + * @param string $organisation (required) + * @param string $project (required) + * @param \QuantClient\Model\AiSearchUpdateSettingsRequest $ai_search_update_settings_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchUpdateSettings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchUpdateSettingsRequest($organisation, $project, $ai_search_update_settings_request, string $contentType = self::contentTypes['aiSearchUpdateSettings'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchUpdateSettings' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchUpdateSettings' + ); + } + + // verify the required parameter 'ai_search_update_settings_request' is set + if ($ai_search_update_settings_request === null || (is_array($ai_search_update_settings_request) && count($ai_search_update_settings_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ai_search_update_settings_request when calling aiSearchUpdateSettings' + ); + } + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($ai_search_update_settings_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($ai_search_update_settings_request)); + } else { + $httpBody = $ai_search_update_settings_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation aiSearchUsage + * + * Get usage statistics for the AI Search site + * + * @param string $organisation organisation (required) + * @param string $project project (required) + * @param string|null $range range (optional, default to '30d') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchUsage'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function aiSearchUsage($organisation, $project, $range = '30d', string $contentType = self::contentTypes['aiSearchUsage'][0]) + { + $this->aiSearchUsageWithHttpInfo($organisation, $project, $range, $contentType); + } + + /** + * Operation aiSearchUsageWithHttpInfo + * + * Get usage statistics for the AI Search site + * + * @param string $organisation (required) + * @param string $project (required) + * @param string|null $range (optional, default to '30d') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchUsage'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function aiSearchUsageWithHttpInfo($organisation, $project, $range = '30d', string $contentType = self::contentTypes['aiSearchUsage'][0]) + { + $request = $this->aiSearchUsageRequest($organisation, $project, $range, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation aiSearchUsageAsync + * + * Get usage statistics for the AI Search site + * + * @param string $organisation (required) + * @param string $project (required) + * @param string|null $range (optional, default to '30d') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchUsage'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchUsageAsync($organisation, $project, $range = '30d', string $contentType = self::contentTypes['aiSearchUsage'][0]) + { + return $this->aiSearchUsageAsyncWithHttpInfo($organisation, $project, $range, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation aiSearchUsageAsyncWithHttpInfo + * + * Get usage statistics for the AI Search site + * + * @param string $organisation (required) + * @param string $project (required) + * @param string|null $range (optional, default to '30d') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchUsage'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function aiSearchUsageAsyncWithHttpInfo($organisation, $project, $range = '30d', string $contentType = self::contentTypes['aiSearchUsage'][0]) + { + $returnType = ''; + $request = $this->aiSearchUsageRequest($organisation, $project, $range, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'aiSearchUsage' + * + * @param string $organisation (required) + * @param string $project (required) + * @param string|null $range (optional, default to '30d') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['aiSearchUsage'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function aiSearchUsageRequest($organisation, $project, $range = '30d', string $contentType = self::contentTypes['aiSearchUsage'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling aiSearchUsage' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling aiSearchUsage' + ); + } + + + + $resourcePath = '/api/v3/organisations/{organisation}/projects/{project}/ai-search/usage'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $range, + 'range', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/src/Api/AISessionsApi.php b/src/Api/AISessionsApi.php index b852b4bd..565def99 100644 --- a/src/Api/AISessionsApi.php +++ b/src/Api/AISessionsApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/AISkillsApi.php b/src/Api/AISkillsApi.php new file mode 100644 index 00000000..1462f375 --- /dev/null +++ b/src/Api/AISkillsApi.php @@ -0,0 +1,3458 @@ + [ + 'application/json', + ], + 'deleteSkill' => [ + 'application/json', + ], + 'deleteSkillCollection' => [ + 'application/json', + ], + 'getSkill' => [ + 'application/json', + ], + 'importSkill' => [ + 'application/json', + ], + 'importSkillCollection' => [ + 'application/json', + ], + 'listSkillCollections' => [ + 'application/json', + ], + 'listSkills' => [ + 'application/json', + ], + 'syncSkill' => [ + 'application/json', + ], + 'syncSkillCollection' => [ + 'application/json', + ], + 'updateSkill' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createSkill + * + * Create Inline Skill + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\CreateSkillRequest $create_skill_request create_skill_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSkill'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\CreateSkill201Response + */ + public function createSkill($organisation, $create_skill_request, string $contentType = self::contentTypes['createSkill'][0]) + { + list($response) = $this->createSkillWithHttpInfo($organisation, $create_skill_request, $contentType); + return $response; + } + + /** + * Operation createSkillWithHttpInfo + * + * Create Inline Skill + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\CreateSkillRequest $create_skill_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSkill'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\CreateSkill201Response, HTTP status code, HTTP response headers (array of strings) + */ + public function createSkillWithHttpInfo($organisation, $create_skill_request, string $contentType = self::contentTypes['createSkill'][0]) + { + $request = $this->createSkillRequest($organisation, $create_skill_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + return $this->handleResponseWithDataType( + '\QuantClient\Model\CreateSkill201Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\CreateSkill201Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\CreateSkill201Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation createSkillAsync + * + * Create Inline Skill + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\CreateSkillRequest $create_skill_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSkillAsync($organisation, $create_skill_request, string $contentType = self::contentTypes['createSkill'][0]) + { + return $this->createSkillAsyncWithHttpInfo($organisation, $create_skill_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createSkillAsyncWithHttpInfo + * + * Create Inline Skill + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\CreateSkillRequest $create_skill_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSkillAsyncWithHttpInfo($organisation, $create_skill_request, string $contentType = self::contentTypes['createSkill'][0]) + { + $returnType = '\QuantClient\Model\CreateSkill201Response'; + $request = $this->createSkillRequest($organisation, $create_skill_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createSkill' + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\CreateSkillRequest $create_skill_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createSkillRequest($organisation, $create_skill_request, string $contentType = self::contentTypes['createSkill'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling createSkill' + ); + } + + // verify the required parameter 'create_skill_request' is set + if ($create_skill_request === null || (is_array($create_skill_request) && count($create_skill_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $create_skill_request when calling createSkill' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/skills'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($create_skill_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_skill_request)); + } else { + $httpBody = $create_skill_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteSkill + * + * Delete Skill + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSkill'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\DeleteSkill200Response + */ + public function deleteSkill($organisation, $skill_id, string $contentType = self::contentTypes['deleteSkill'][0]) + { + list($response) = $this->deleteSkillWithHttpInfo($organisation, $skill_id, $contentType); + return $response; + } + + /** + * Operation deleteSkillWithHttpInfo + * + * Delete Skill + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSkill'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\DeleteSkill200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteSkillWithHttpInfo($organisation, $skill_id, string $contentType = self::contentTypes['deleteSkill'][0]) + { + $request = $this->deleteSkillRequest($organisation, $skill_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\DeleteSkill200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\DeleteSkill200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\DeleteSkill200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation deleteSkillAsync + * + * Delete Skill + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSkillAsync($organisation, $skill_id, string $contentType = self::contentTypes['deleteSkill'][0]) + { + return $this->deleteSkillAsyncWithHttpInfo($organisation, $skill_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteSkillAsyncWithHttpInfo + * + * Delete Skill + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSkillAsyncWithHttpInfo($organisation, $skill_id, string $contentType = self::contentTypes['deleteSkill'][0]) + { + $returnType = '\QuantClient\Model\DeleteSkill200Response'; + $request = $this->deleteSkillRequest($organisation, $skill_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteSkill' + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteSkillRequest($organisation, $skill_id, string $contentType = self::contentTypes['deleteSkill'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling deleteSkill' + ); + } + + // verify the required parameter 'skill_id' is set + if ($skill_id === null || (is_array($skill_id) && count($skill_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $skill_id when calling deleteSkill' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/skills/{skillId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($skill_id !== null) { + $resourcePath = str_replace( + '{' . 'skillId' . '}', + ObjectSerializer::toPathValue($skill_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteSkillCollection + * + * Delete Skill Collection + * + * @param string $organisation The organisation ID (required) + * @param string $namespace Collection namespace (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSkillCollection'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\DeleteSkillCollection200Response + */ + public function deleteSkillCollection($organisation, $namespace, string $contentType = self::contentTypes['deleteSkillCollection'][0]) + { + list($response) = $this->deleteSkillCollectionWithHttpInfo($organisation, $namespace, $contentType); + return $response; + } + + /** + * Operation deleteSkillCollectionWithHttpInfo + * + * Delete Skill Collection + * + * @param string $organisation The organisation ID (required) + * @param string $namespace Collection namespace (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSkillCollection'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\DeleteSkillCollection200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteSkillCollectionWithHttpInfo($organisation, $namespace, string $contentType = self::contentTypes['deleteSkillCollection'][0]) + { + $request = $this->deleteSkillCollectionRequest($organisation, $namespace, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\DeleteSkillCollection200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\DeleteSkillCollection200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\DeleteSkillCollection200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation deleteSkillCollectionAsync + * + * Delete Skill Collection + * + * @param string $organisation The organisation ID (required) + * @param string $namespace Collection namespace (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSkillCollection'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSkillCollectionAsync($organisation, $namespace, string $contentType = self::contentTypes['deleteSkillCollection'][0]) + { + return $this->deleteSkillCollectionAsyncWithHttpInfo($organisation, $namespace, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteSkillCollectionAsyncWithHttpInfo + * + * Delete Skill Collection + * + * @param string $organisation The organisation ID (required) + * @param string $namespace Collection namespace (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSkillCollection'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSkillCollectionAsyncWithHttpInfo($organisation, $namespace, string $contentType = self::contentTypes['deleteSkillCollection'][0]) + { + $returnType = '\QuantClient\Model\DeleteSkillCollection200Response'; + $request = $this->deleteSkillCollectionRequest($organisation, $namespace, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteSkillCollection' + * + * @param string $organisation The organisation ID (required) + * @param string $namespace Collection namespace (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSkillCollection'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteSkillCollectionRequest($organisation, $namespace, string $contentType = self::contentTypes['deleteSkillCollection'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling deleteSkillCollection' + ); + } + + // verify the required parameter 'namespace' is set + if ($namespace === null || (is_array($namespace) && count($namespace) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $namespace when calling deleteSkillCollection' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/skills/collections/{namespace}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($namespace !== null) { + $resourcePath = str_replace( + '{' . 'namespace' . '}', + ObjectSerializer::toPathValue($namespace), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSkill + * + * Get Skill Details + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSkill'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\GetSkill200Response + */ + public function getSkill($organisation, $skill_id, string $contentType = self::contentTypes['getSkill'][0]) + { + list($response) = $this->getSkillWithHttpInfo($organisation, $skill_id, $contentType); + return $response; + } + + /** + * Operation getSkillWithHttpInfo + * + * Get Skill Details + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSkill'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\GetSkill200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getSkillWithHttpInfo($organisation, $skill_id, string $contentType = self::contentTypes['getSkill'][0]) + { + $request = $this->getSkillRequest($organisation, $skill_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\GetSkill200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\GetSkill200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\GetSkill200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getSkillAsync + * + * Get Skill Details + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSkillAsync($organisation, $skill_id, string $contentType = self::contentTypes['getSkill'][0]) + { + return $this->getSkillAsyncWithHttpInfo($organisation, $skill_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSkillAsyncWithHttpInfo + * + * Get Skill Details + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSkillAsyncWithHttpInfo($organisation, $skill_id, string $contentType = self::contentTypes['getSkill'][0]) + { + $returnType = '\QuantClient\Model\GetSkill200Response'; + $request = $this->getSkillRequest($organisation, $skill_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSkill' + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSkillRequest($organisation, $skill_id, string $contentType = self::contentTypes['getSkill'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling getSkill' + ); + } + + // verify the required parameter 'skill_id' is set + if ($skill_id === null || (is_array($skill_id) && count($skill_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $skill_id when calling getSkill' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/skills/{skillId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($skill_id !== null) { + $resourcePath = str_replace( + '{' . 'skillId' . '}', + ObjectSerializer::toPathValue($skill_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importSkill + * + * Import Skill from External Source + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\ImportSkillRequest $import_skill_request import_skill_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importSkill'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\ImportSkill201Response + */ + public function importSkill($organisation, $import_skill_request, string $contentType = self::contentTypes['importSkill'][0]) + { + list($response) = $this->importSkillWithHttpInfo($organisation, $import_skill_request, $contentType); + return $response; + } + + /** + * Operation importSkillWithHttpInfo + * + * Import Skill from External Source + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\ImportSkillRequest $import_skill_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importSkill'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\ImportSkill201Response, HTTP status code, HTTP response headers (array of strings) + */ + public function importSkillWithHttpInfo($organisation, $import_skill_request, string $contentType = self::contentTypes['importSkill'][0]) + { + $request = $this->importSkillRequest($organisation, $import_skill_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + return $this->handleResponseWithDataType( + '\QuantClient\Model\ImportSkill201Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\ImportSkill201Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\ImportSkill201Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation importSkillAsync + * + * Import Skill from External Source + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\ImportSkillRequest $import_skill_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importSkillAsync($organisation, $import_skill_request, string $contentType = self::contentTypes['importSkill'][0]) + { + return $this->importSkillAsyncWithHttpInfo($organisation, $import_skill_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importSkillAsyncWithHttpInfo + * + * Import Skill from External Source + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\ImportSkillRequest $import_skill_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importSkillAsyncWithHttpInfo($organisation, $import_skill_request, string $contentType = self::contentTypes['importSkill'][0]) + { + $returnType = '\QuantClient\Model\ImportSkill201Response'; + $request = $this->importSkillRequest($organisation, $import_skill_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importSkill' + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\ImportSkillRequest $import_skill_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importSkillRequest($organisation, $import_skill_request, string $contentType = self::contentTypes['importSkill'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling importSkill' + ); + } + + // verify the required parameter 'import_skill_request' is set + if ($import_skill_request === null || (is_array($import_skill_request) && count($import_skill_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $import_skill_request when calling importSkill' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/skills/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($import_skill_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($import_skill_request)); + } else { + $httpBody = $import_skill_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importSkillCollection + * + * Import Skill Collection from GitHub + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\ImportSkillCollectionRequest $import_skill_collection_request import_skill_collection_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importSkillCollection'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\ImportSkillCollection201Response + */ + public function importSkillCollection($organisation, $import_skill_collection_request, string $contentType = self::contentTypes['importSkillCollection'][0]) + { + list($response) = $this->importSkillCollectionWithHttpInfo($organisation, $import_skill_collection_request, $contentType); + return $response; + } + + /** + * Operation importSkillCollectionWithHttpInfo + * + * Import Skill Collection from GitHub + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\ImportSkillCollectionRequest $import_skill_collection_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importSkillCollection'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\ImportSkillCollection201Response, HTTP status code, HTTP response headers (array of strings) + */ + public function importSkillCollectionWithHttpInfo($organisation, $import_skill_collection_request, string $contentType = self::contentTypes['importSkillCollection'][0]) + { + $request = $this->importSkillCollectionRequest($organisation, $import_skill_collection_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + return $this->handleResponseWithDataType( + '\QuantClient\Model\ImportSkillCollection201Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\ImportSkillCollection201Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\ImportSkillCollection201Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation importSkillCollectionAsync + * + * Import Skill Collection from GitHub + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\ImportSkillCollectionRequest $import_skill_collection_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importSkillCollection'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importSkillCollectionAsync($organisation, $import_skill_collection_request, string $contentType = self::contentTypes['importSkillCollection'][0]) + { + return $this->importSkillCollectionAsyncWithHttpInfo($organisation, $import_skill_collection_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importSkillCollectionAsyncWithHttpInfo + * + * Import Skill Collection from GitHub + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\ImportSkillCollectionRequest $import_skill_collection_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importSkillCollection'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importSkillCollectionAsyncWithHttpInfo($organisation, $import_skill_collection_request, string $contentType = self::contentTypes['importSkillCollection'][0]) + { + $returnType = '\QuantClient\Model\ImportSkillCollection201Response'; + $request = $this->importSkillCollectionRequest($organisation, $import_skill_collection_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importSkillCollection' + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\ImportSkillCollectionRequest $import_skill_collection_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importSkillCollection'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function importSkillCollectionRequest($organisation, $import_skill_collection_request, string $contentType = self::contentTypes['importSkillCollection'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling importSkillCollection' + ); + } + + // verify the required parameter 'import_skill_collection_request' is set + if ($import_skill_collection_request === null || (is_array($import_skill_collection_request) && count($import_skill_collection_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $import_skill_collection_request when calling importSkillCollection' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/skills/import-collection'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($import_skill_collection_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($import_skill_collection_request)); + } else { + $httpBody = $import_skill_collection_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listSkillCollections + * + * List Skill Collections + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSkillCollections'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\ListSkillCollections200Response + */ + public function listSkillCollections($organisation, string $contentType = self::contentTypes['listSkillCollections'][0]) + { + list($response) = $this->listSkillCollectionsWithHttpInfo($organisation, $contentType); + return $response; + } + + /** + * Operation listSkillCollectionsWithHttpInfo + * + * List Skill Collections + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSkillCollections'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\ListSkillCollections200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listSkillCollectionsWithHttpInfo($organisation, string $contentType = self::contentTypes['listSkillCollections'][0]) + { + $request = $this->listSkillCollectionsRequest($organisation, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\ListSkillCollections200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\ListSkillCollections200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\ListSkillCollections200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation listSkillCollectionsAsync + * + * List Skill Collections + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSkillCollections'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSkillCollectionsAsync($organisation, string $contentType = self::contentTypes['listSkillCollections'][0]) + { + return $this->listSkillCollectionsAsyncWithHttpInfo($organisation, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listSkillCollectionsAsyncWithHttpInfo + * + * List Skill Collections + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSkillCollections'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSkillCollectionsAsyncWithHttpInfo($organisation, string $contentType = self::contentTypes['listSkillCollections'][0]) + { + $returnType = '\QuantClient\Model\ListSkillCollections200Response'; + $request = $this->listSkillCollectionsRequest($organisation, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listSkillCollections' + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSkillCollections'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listSkillCollectionsRequest($organisation, string $contentType = self::contentTypes['listSkillCollections'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling listSkillCollections' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/skills/collections'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listSkills + * + * List Organization's Skills + * + * @param string $organisation The organisation ID (required) + * @param string|null $tag Filter skills by tag (optional) + * @param string|null $namespace Filter skills by collection namespace (e.g. 'superpowers') (optional) + * @param int|null $limit Maximum number of skills to return (optional, default to 50) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSkills'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\ListSkills200Response + */ + public function listSkills($organisation, $tag = null, $namespace = null, $limit = 50, string $contentType = self::contentTypes['listSkills'][0]) + { + list($response) = $this->listSkillsWithHttpInfo($organisation, $tag, $namespace, $limit, $contentType); + return $response; + } + + /** + * Operation listSkillsWithHttpInfo + * + * List Organization's Skills + * + * @param string $organisation The organisation ID (required) + * @param string|null $tag Filter skills by tag (optional) + * @param string|null $namespace Filter skills by collection namespace (e.g. 'superpowers') (optional) + * @param int|null $limit Maximum number of skills to return (optional, default to 50) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSkills'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\ListSkills200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listSkillsWithHttpInfo($organisation, $tag = null, $namespace = null, $limit = 50, string $contentType = self::contentTypes['listSkills'][0]) + { + $request = $this->listSkillsRequest($organisation, $tag, $namespace, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\ListSkills200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\ListSkills200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\ListSkills200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation listSkillsAsync + * + * List Organization's Skills + * + * @param string $organisation The organisation ID (required) + * @param string|null $tag Filter skills by tag (optional) + * @param string|null $namespace Filter skills by collection namespace (e.g. 'superpowers') (optional) + * @param int|null $limit Maximum number of skills to return (optional, default to 50) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSkills'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSkillsAsync($organisation, $tag = null, $namespace = null, $limit = 50, string $contentType = self::contentTypes['listSkills'][0]) + { + return $this->listSkillsAsyncWithHttpInfo($organisation, $tag, $namespace, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listSkillsAsyncWithHttpInfo + * + * List Organization's Skills + * + * @param string $organisation The organisation ID (required) + * @param string|null $tag Filter skills by tag (optional) + * @param string|null $namespace Filter skills by collection namespace (e.g. 'superpowers') (optional) + * @param int|null $limit Maximum number of skills to return (optional, default to 50) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSkills'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSkillsAsyncWithHttpInfo($organisation, $tag = null, $namespace = null, $limit = 50, string $contentType = self::contentTypes['listSkills'][0]) + { + $returnType = '\QuantClient\Model\ListSkills200Response'; + $request = $this->listSkillsRequest($organisation, $tag, $namespace, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listSkills' + * + * @param string $organisation The organisation ID (required) + * @param string|null $tag Filter skills by tag (optional) + * @param string|null $namespace Filter skills by collection namespace (e.g. 'superpowers') (optional) + * @param int|null $limit Maximum number of skills to return (optional, default to 50) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSkills'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listSkillsRequest($organisation, $tag = null, $namespace = null, $limit = 50, string $contentType = self::contentTypes['listSkills'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling listSkills' + ); + } + + + + if ($limit !== null && $limit > 100) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling AISkillsApi.listSkills, must be smaller than or equal to 100.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling AISkillsApi.listSkills, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/skills'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $tag, + 'tag', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $namespace, + 'namespace', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation syncSkill + * + * Sync Skill from Source + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncSkill'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\ImportSkill201Response + */ + public function syncSkill($organisation, $skill_id, string $contentType = self::contentTypes['syncSkill'][0]) + { + list($response) = $this->syncSkillWithHttpInfo($organisation, $skill_id, $contentType); + return $response; + } + + /** + * Operation syncSkillWithHttpInfo + * + * Sync Skill from Source + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncSkill'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\ImportSkill201Response, HTTP status code, HTTP response headers (array of strings) + */ + public function syncSkillWithHttpInfo($organisation, $skill_id, string $contentType = self::contentTypes['syncSkill'][0]) + { + $request = $this->syncSkillRequest($organisation, $skill_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\ImportSkill201Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\ImportSkill201Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\ImportSkill201Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation syncSkillAsync + * + * Sync Skill from Source + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function syncSkillAsync($organisation, $skill_id, string $contentType = self::contentTypes['syncSkill'][0]) + { + return $this->syncSkillAsyncWithHttpInfo($organisation, $skill_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation syncSkillAsyncWithHttpInfo + * + * Sync Skill from Source + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function syncSkillAsyncWithHttpInfo($organisation, $skill_id, string $contentType = self::contentTypes['syncSkill'][0]) + { + $returnType = '\QuantClient\Model\ImportSkill201Response'; + $request = $this->syncSkillRequest($organisation, $skill_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'syncSkill' + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function syncSkillRequest($organisation, $skill_id, string $contentType = self::contentTypes['syncSkill'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling syncSkill' + ); + } + + // verify the required parameter 'skill_id' is set + if ($skill_id === null || (is_array($skill_id) && count($skill_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $skill_id when calling syncSkill' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/skills/{skillId}/sync'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($skill_id !== null) { + $resourcePath = str_replace( + '{' . 'skillId' . '}', + ObjectSerializer::toPathValue($skill_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation syncSkillCollection + * + * Sync Skill Collection + * + * @param string $organisation The organisation ID (required) + * @param string $namespace Collection namespace (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncSkillCollection'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\SyncSkillCollection200Response + */ + public function syncSkillCollection($organisation, $namespace, string $contentType = self::contentTypes['syncSkillCollection'][0]) + { + list($response) = $this->syncSkillCollectionWithHttpInfo($organisation, $namespace, $contentType); + return $response; + } + + /** + * Operation syncSkillCollectionWithHttpInfo + * + * Sync Skill Collection + * + * @param string $organisation The organisation ID (required) + * @param string $namespace Collection namespace (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncSkillCollection'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\SyncSkillCollection200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function syncSkillCollectionWithHttpInfo($organisation, $namespace, string $contentType = self::contentTypes['syncSkillCollection'][0]) + { + $request = $this->syncSkillCollectionRequest($organisation, $namespace, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\SyncSkillCollection200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\SyncSkillCollection200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\SyncSkillCollection200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation syncSkillCollectionAsync + * + * Sync Skill Collection + * + * @param string $organisation The organisation ID (required) + * @param string $namespace Collection namespace (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncSkillCollection'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function syncSkillCollectionAsync($organisation, $namespace, string $contentType = self::contentTypes['syncSkillCollection'][0]) + { + return $this->syncSkillCollectionAsyncWithHttpInfo($organisation, $namespace, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation syncSkillCollectionAsyncWithHttpInfo + * + * Sync Skill Collection + * + * @param string $organisation The organisation ID (required) + * @param string $namespace Collection namespace (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncSkillCollection'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function syncSkillCollectionAsyncWithHttpInfo($organisation, $namespace, string $contentType = self::contentTypes['syncSkillCollection'][0]) + { + $returnType = '\QuantClient\Model\SyncSkillCollection200Response'; + $request = $this->syncSkillCollectionRequest($organisation, $namespace, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'syncSkillCollection' + * + * @param string $organisation The organisation ID (required) + * @param string $namespace Collection namespace (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['syncSkillCollection'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function syncSkillCollectionRequest($organisation, $namespace, string $contentType = self::contentTypes['syncSkillCollection'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling syncSkillCollection' + ); + } + + // verify the required parameter 'namespace' is set + if ($namespace === null || (is_array($namespace) && count($namespace) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $namespace when calling syncSkillCollection' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/skills/collections/{namespace}/sync'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($namespace !== null) { + $resourcePath = str_replace( + '{' . 'namespace' . '}', + ObjectSerializer::toPathValue($namespace), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateSkill + * + * Update Skill + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param \QuantClient\Model\UpdateSkillRequest $update_skill_request update_skill_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSkill'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\UpdateSkill200Response + */ + public function updateSkill($organisation, $skill_id, $update_skill_request, string $contentType = self::contentTypes['updateSkill'][0]) + { + list($response) = $this->updateSkillWithHttpInfo($organisation, $skill_id, $update_skill_request, $contentType); + return $response; + } + + /** + * Operation updateSkillWithHttpInfo + * + * Update Skill + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param \QuantClient\Model\UpdateSkillRequest $update_skill_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSkill'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\UpdateSkill200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function updateSkillWithHttpInfo($organisation, $skill_id, $update_skill_request, string $contentType = self::contentTypes['updateSkill'][0]) + { + $request = $this->updateSkillRequest($organisation, $skill_id, $update_skill_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\UpdateSkill200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\UpdateSkill200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\UpdateSkill200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation updateSkillAsync + * + * Update Skill + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param \QuantClient\Model\UpdateSkillRequest $update_skill_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSkillAsync($organisation, $skill_id, $update_skill_request, string $contentType = self::contentTypes['updateSkill'][0]) + { + return $this->updateSkillAsyncWithHttpInfo($organisation, $skill_id, $update_skill_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateSkillAsyncWithHttpInfo + * + * Update Skill + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param \QuantClient\Model\UpdateSkillRequest $update_skill_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSkillAsyncWithHttpInfo($organisation, $skill_id, $update_skill_request, string $contentType = self::contentTypes['updateSkill'][0]) + { + $returnType = '\QuantClient\Model\UpdateSkill200Response'; + $request = $this->updateSkillRequest($organisation, $skill_id, $update_skill_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateSkill' + * + * @param string $organisation The organisation ID (required) + * @param string $skill_id The skill ID (required) + * @param \QuantClient\Model\UpdateSkillRequest $update_skill_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSkill'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateSkillRequest($organisation, $skill_id, $update_skill_request, string $contentType = self::contentTypes['updateSkill'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling updateSkill' + ); + } + + // verify the required parameter 'skill_id' is set + if ($skill_id === null || (is_array($skill_id) && count($skill_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $skill_id when calling updateSkill' + ); + } + + // verify the required parameter 'update_skill_request' is set + if ($update_skill_request === null || (is_array($update_skill_request) && count($update_skill_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_skill_request when calling updateSkill' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/skills/{skillId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($skill_id !== null) { + $resourcePath = str_replace( + '{' . 'skillId' . '}', + ObjectSerializer::toPathValue($skill_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_skill_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_skill_request)); + } else { + $httpBody = $update_skill_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/src/Api/AISlackBotsApi.php b/src/Api/AISlackBotsApi.php new file mode 100644 index 00000000..72f066d6 --- /dev/null +++ b/src/Api/AISlackBotsApi.php @@ -0,0 +1,2279 @@ + [ + 'application/json', + ], + 'deleteSlackBot' => [ + 'application/json', + ], + 'getSlackBot' => [ + 'application/json', + ], + 'listSlackBots' => [ + 'application/json', + ], + 'searchSlackWorkspaceChannels' => [ + 'application/json', + ], + 'searchSlackWorkspaceUsers' => [ + 'application/json', + ], + 'updateSlackBot' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createSlackBot + * + * Create Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\CreateSlackBotRequest $create_slack_bot_request create_slack_bot_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSlackBot'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\CreateSlackBot201Response + */ + public function createSlackBot($organisation, $create_slack_bot_request, string $contentType = self::contentTypes['createSlackBot'][0]) + { + list($response) = $this->createSlackBotWithHttpInfo($organisation, $create_slack_bot_request, $contentType); + return $response; + } + + /** + * Operation createSlackBotWithHttpInfo + * + * Create Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\CreateSlackBotRequest $create_slack_bot_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSlackBot'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\CreateSlackBot201Response, HTTP status code, HTTP response headers (array of strings) + */ + public function createSlackBotWithHttpInfo($organisation, $create_slack_bot_request, string $contentType = self::contentTypes['createSlackBot'][0]) + { + $request = $this->createSlackBotRequest($organisation, $create_slack_bot_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + return $this->handleResponseWithDataType( + '\QuantClient\Model\CreateSlackBot201Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\CreateSlackBot201Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\CreateSlackBot201Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation createSlackBotAsync + * + * Create Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\CreateSlackBotRequest $create_slack_bot_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSlackBot'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSlackBotAsync($organisation, $create_slack_bot_request, string $contentType = self::contentTypes['createSlackBot'][0]) + { + return $this->createSlackBotAsyncWithHttpInfo($organisation, $create_slack_bot_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createSlackBotAsyncWithHttpInfo + * + * Create Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\CreateSlackBotRequest $create_slack_bot_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSlackBot'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSlackBotAsyncWithHttpInfo($organisation, $create_slack_bot_request, string $contentType = self::contentTypes['createSlackBot'][0]) + { + $returnType = '\QuantClient\Model\CreateSlackBot201Response'; + $request = $this->createSlackBotRequest($organisation, $create_slack_bot_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createSlackBot' + * + * @param string $organisation The organisation ID (required) + * @param \QuantClient\Model\CreateSlackBotRequest $create_slack_bot_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSlackBot'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createSlackBotRequest($organisation, $create_slack_bot_request, string $contentType = self::contentTypes['createSlackBot'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling createSlackBot' + ); + } + + // verify the required parameter 'create_slack_bot_request' is set + if ($create_slack_bot_request === null || (is_array($create_slack_bot_request) && count($create_slack_bot_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $create_slack_bot_request when calling createSlackBot' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/slack-bots'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($create_slack_bot_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_slack_bot_request)); + } else { + $httpBody = $create_slack_bot_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteSlackBot + * + * Delete Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSlackBot'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\DeleteSlackBot200Response + */ + public function deleteSlackBot($organisation, $bot_id, string $contentType = self::contentTypes['deleteSlackBot'][0]) + { + list($response) = $this->deleteSlackBotWithHttpInfo($organisation, $bot_id, $contentType); + return $response; + } + + /** + * Operation deleteSlackBotWithHttpInfo + * + * Delete Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSlackBot'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\DeleteSlackBot200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteSlackBotWithHttpInfo($organisation, $bot_id, string $contentType = self::contentTypes['deleteSlackBot'][0]) + { + $request = $this->deleteSlackBotRequest($organisation, $bot_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\DeleteSlackBot200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\DeleteSlackBot200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\DeleteSlackBot200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation deleteSlackBotAsync + * + * Delete Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSlackBot'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSlackBotAsync($organisation, $bot_id, string $contentType = self::contentTypes['deleteSlackBot'][0]) + { + return $this->deleteSlackBotAsyncWithHttpInfo($organisation, $bot_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteSlackBotAsyncWithHttpInfo + * + * Delete Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSlackBot'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSlackBotAsyncWithHttpInfo($organisation, $bot_id, string $contentType = self::contentTypes['deleteSlackBot'][0]) + { + $returnType = '\QuantClient\Model\DeleteSlackBot200Response'; + $request = $this->deleteSlackBotRequest($organisation, $bot_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteSlackBot' + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSlackBot'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteSlackBotRequest($organisation, $bot_id, string $contentType = self::contentTypes['deleteSlackBot'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling deleteSlackBot' + ); + } + + // verify the required parameter 'bot_id' is set + if ($bot_id === null || (is_array($bot_id) && count($bot_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $bot_id when calling deleteSlackBot' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/slack-bots/{botId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($bot_id !== null) { + $resourcePath = str_replace( + '{' . 'botId' . '}', + ObjectSerializer::toPathValue($bot_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSlackBot + * + * Get Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSlackBot'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\GetSlackBot200Response + */ + public function getSlackBot($organisation, $bot_id, string $contentType = self::contentTypes['getSlackBot'][0]) + { + list($response) = $this->getSlackBotWithHttpInfo($organisation, $bot_id, $contentType); + return $response; + } + + /** + * Operation getSlackBotWithHttpInfo + * + * Get Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSlackBot'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\GetSlackBot200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getSlackBotWithHttpInfo($organisation, $bot_id, string $contentType = self::contentTypes['getSlackBot'][0]) + { + $request = $this->getSlackBotRequest($organisation, $bot_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\GetSlackBot200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\GetSlackBot200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\GetSlackBot200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getSlackBotAsync + * + * Get Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSlackBot'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSlackBotAsync($organisation, $bot_id, string $contentType = self::contentTypes['getSlackBot'][0]) + { + return $this->getSlackBotAsyncWithHttpInfo($organisation, $bot_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSlackBotAsyncWithHttpInfo + * + * Get Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSlackBot'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSlackBotAsyncWithHttpInfo($organisation, $bot_id, string $contentType = self::contentTypes['getSlackBot'][0]) + { + $returnType = '\QuantClient\Model\GetSlackBot200Response'; + $request = $this->getSlackBotRequest($organisation, $bot_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSlackBot' + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSlackBot'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSlackBotRequest($organisation, $bot_id, string $contentType = self::contentTypes['getSlackBot'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling getSlackBot' + ); + } + + // verify the required parameter 'bot_id' is set + if ($bot_id === null || (is_array($bot_id) && count($bot_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $bot_id when calling getSlackBot' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/slack-bots/{botId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($bot_id !== null) { + $resourcePath = str_replace( + '{' . 'botId' . '}', + ObjectSerializer::toPathValue($bot_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listSlackBots + * + * List Slack Bots + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSlackBots'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\ListSlackBots200Response + */ + public function listSlackBots($organisation, string $contentType = self::contentTypes['listSlackBots'][0]) + { + list($response) = $this->listSlackBotsWithHttpInfo($organisation, $contentType); + return $response; + } + + /** + * Operation listSlackBotsWithHttpInfo + * + * List Slack Bots + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSlackBots'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\ListSlackBots200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function listSlackBotsWithHttpInfo($organisation, string $contentType = self::contentTypes['listSlackBots'][0]) + { + $request = $this->listSlackBotsRequest($organisation, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\ListSlackBots200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\ListSlackBots200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\ListSlackBots200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation listSlackBotsAsync + * + * List Slack Bots + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSlackBots'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSlackBotsAsync($organisation, string $contentType = self::contentTypes['listSlackBots'][0]) + { + return $this->listSlackBotsAsyncWithHttpInfo($organisation, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listSlackBotsAsyncWithHttpInfo + * + * List Slack Bots + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSlackBots'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listSlackBotsAsyncWithHttpInfo($organisation, string $contentType = self::contentTypes['listSlackBots'][0]) + { + $returnType = '\QuantClient\Model\ListSlackBots200Response'; + $request = $this->listSlackBotsRequest($organisation, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listSlackBots' + * + * @param string $organisation The organisation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSlackBots'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listSlackBotsRequest($organisation, string $contentType = self::contentTypes['listSlackBots'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling listSlackBots' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/slack-bots'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchSlackWorkspaceChannels + * + * Search Slack Workspace Channels + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string|null $q Search query to filter channels by name (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchSlackWorkspaceChannels'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\SearchSlackWorkspaceChannels200Response + */ + public function searchSlackWorkspaceChannels($organisation, $bot_id, $q = null, string $contentType = self::contentTypes['searchSlackWorkspaceChannels'][0]) + { + list($response) = $this->searchSlackWorkspaceChannelsWithHttpInfo($organisation, $bot_id, $q, $contentType); + return $response; + } + + /** + * Operation searchSlackWorkspaceChannelsWithHttpInfo + * + * Search Slack Workspace Channels + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string|null $q Search query to filter channels by name (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchSlackWorkspaceChannels'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\SearchSlackWorkspaceChannels200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function searchSlackWorkspaceChannelsWithHttpInfo($organisation, $bot_id, $q = null, string $contentType = self::contentTypes['searchSlackWorkspaceChannels'][0]) + { + $request = $this->searchSlackWorkspaceChannelsRequest($organisation, $bot_id, $q, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\SearchSlackWorkspaceChannels200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\SearchSlackWorkspaceChannels200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\SearchSlackWorkspaceChannels200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation searchSlackWorkspaceChannelsAsync + * + * Search Slack Workspace Channels + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string|null $q Search query to filter channels by name (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchSlackWorkspaceChannels'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function searchSlackWorkspaceChannelsAsync($organisation, $bot_id, $q = null, string $contentType = self::contentTypes['searchSlackWorkspaceChannels'][0]) + { + return $this->searchSlackWorkspaceChannelsAsyncWithHttpInfo($organisation, $bot_id, $q, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchSlackWorkspaceChannelsAsyncWithHttpInfo + * + * Search Slack Workspace Channels + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string|null $q Search query to filter channels by name (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchSlackWorkspaceChannels'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function searchSlackWorkspaceChannelsAsyncWithHttpInfo($organisation, $bot_id, $q = null, string $contentType = self::contentTypes['searchSlackWorkspaceChannels'][0]) + { + $returnType = '\QuantClient\Model\SearchSlackWorkspaceChannels200Response'; + $request = $this->searchSlackWorkspaceChannelsRequest($organisation, $bot_id, $q, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchSlackWorkspaceChannels' + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string|null $q Search query to filter channels by name (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchSlackWorkspaceChannels'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function searchSlackWorkspaceChannelsRequest($organisation, $bot_id, $q = null, string $contentType = self::contentTypes['searchSlackWorkspaceChannels'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling searchSlackWorkspaceChannels' + ); + } + + // verify the required parameter 'bot_id' is set + if ($bot_id === null || (is_array($bot_id) && count($bot_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $bot_id when calling searchSlackWorkspaceChannels' + ); + } + + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/slack-bots/{botId}/workspace/channels'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $q, + 'q', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($bot_id !== null) { + $resourcePath = str_replace( + '{' . 'botId' . '}', + ObjectSerializer::toPathValue($bot_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchSlackWorkspaceUsers + * + * Search Slack Workspace Users + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string|null $q Search query to filter users by name (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchSlackWorkspaceUsers'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\SearchSlackWorkspaceUsers200Response + */ + public function searchSlackWorkspaceUsers($organisation, $bot_id, $q = null, string $contentType = self::contentTypes['searchSlackWorkspaceUsers'][0]) + { + list($response) = $this->searchSlackWorkspaceUsersWithHttpInfo($organisation, $bot_id, $q, $contentType); + return $response; + } + + /** + * Operation searchSlackWorkspaceUsersWithHttpInfo + * + * Search Slack Workspace Users + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string|null $q Search query to filter users by name (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchSlackWorkspaceUsers'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\SearchSlackWorkspaceUsers200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function searchSlackWorkspaceUsersWithHttpInfo($organisation, $bot_id, $q = null, string $contentType = self::contentTypes['searchSlackWorkspaceUsers'][0]) + { + $request = $this->searchSlackWorkspaceUsersRequest($organisation, $bot_id, $q, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\SearchSlackWorkspaceUsers200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\SearchSlackWorkspaceUsers200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\SearchSlackWorkspaceUsers200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation searchSlackWorkspaceUsersAsync + * + * Search Slack Workspace Users + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string|null $q Search query to filter users by name (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchSlackWorkspaceUsers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function searchSlackWorkspaceUsersAsync($organisation, $bot_id, $q = null, string $contentType = self::contentTypes['searchSlackWorkspaceUsers'][0]) + { + return $this->searchSlackWorkspaceUsersAsyncWithHttpInfo($organisation, $bot_id, $q, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchSlackWorkspaceUsersAsyncWithHttpInfo + * + * Search Slack Workspace Users + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string|null $q Search query to filter users by name (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchSlackWorkspaceUsers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function searchSlackWorkspaceUsersAsyncWithHttpInfo($organisation, $bot_id, $q = null, string $contentType = self::contentTypes['searchSlackWorkspaceUsers'][0]) + { + $returnType = '\QuantClient\Model\SearchSlackWorkspaceUsers200Response'; + $request = $this->searchSlackWorkspaceUsersRequest($organisation, $bot_id, $q, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchSlackWorkspaceUsers' + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param string|null $q Search query to filter users by name (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchSlackWorkspaceUsers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function searchSlackWorkspaceUsersRequest($organisation, $bot_id, $q = null, string $contentType = self::contentTypes['searchSlackWorkspaceUsers'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling searchSlackWorkspaceUsers' + ); + } + + // verify the required parameter 'bot_id' is set + if ($bot_id === null || (is_array($bot_id) && count($bot_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $bot_id when calling searchSlackWorkspaceUsers' + ); + } + + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/slack-bots/{botId}/workspace/users'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $q, + 'q', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($bot_id !== null) { + $resourcePath = str_replace( + '{' . 'botId' . '}', + ObjectSerializer::toPathValue($bot_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateSlackBot + * + * Update Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param \QuantClient\Model\UpdateSlackBotRequest $update_slack_bot_request update_slack_bot_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSlackBot'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\CreateSlackBot201Response + */ + public function updateSlackBot($organisation, $bot_id, $update_slack_bot_request, string $contentType = self::contentTypes['updateSlackBot'][0]) + { + list($response) = $this->updateSlackBotWithHttpInfo($organisation, $bot_id, $update_slack_bot_request, $contentType); + return $response; + } + + /** + * Operation updateSlackBotWithHttpInfo + * + * Update Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param \QuantClient\Model\UpdateSlackBotRequest $update_slack_bot_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSlackBot'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\CreateSlackBot201Response, HTTP status code, HTTP response headers (array of strings) + */ + public function updateSlackBotWithHttpInfo($organisation, $bot_id, $update_slack_bot_request, string $contentType = self::contentTypes['updateSlackBot'][0]) + { + $request = $this->updateSlackBotRequest($organisation, $bot_id, $update_slack_bot_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\CreateSlackBot201Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\CreateSlackBot201Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\CreateSlackBot201Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation updateSlackBotAsync + * + * Update Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param \QuantClient\Model\UpdateSlackBotRequest $update_slack_bot_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSlackBot'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSlackBotAsync($organisation, $bot_id, $update_slack_bot_request, string $contentType = self::contentTypes['updateSlackBot'][0]) + { + return $this->updateSlackBotAsyncWithHttpInfo($organisation, $bot_id, $update_slack_bot_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateSlackBotAsyncWithHttpInfo + * + * Update Slack Bot + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param \QuantClient\Model\UpdateSlackBotRequest $update_slack_bot_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSlackBot'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSlackBotAsyncWithHttpInfo($organisation, $bot_id, $update_slack_bot_request, string $contentType = self::contentTypes['updateSlackBot'][0]) + { + $returnType = '\QuantClient\Model\CreateSlackBot201Response'; + $request = $this->updateSlackBotRequest($organisation, $bot_id, $update_slack_bot_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateSlackBot' + * + * @param string $organisation The organisation ID (required) + * @param string $bot_id The Slack bot ID (required) + * @param \QuantClient\Model\UpdateSlackBotRequest $update_slack_bot_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSlackBot'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateSlackBotRequest($organisation, $bot_id, $update_slack_bot_request, string $contentType = self::contentTypes['updateSlackBot'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling updateSlackBot' + ); + } + + // verify the required parameter 'bot_id' is set + if ($bot_id === null || (is_array($bot_id) && count($bot_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $bot_id when calling updateSlackBot' + ); + } + + // verify the required parameter 'update_slack_bot_request' is set + if ($update_slack_bot_request === null || (is_array($update_slack_bot_request) && count($update_slack_bot_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_slack_bot_request when calling updateSlackBot' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/slack-bots/{botId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($bot_id !== null) { + $resourcePath = str_replace( + '{' . 'botId' . '}', + ObjectSerializer::toPathValue($bot_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_slack_bot_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_slack_bot_request)); + } else { + $httpBody = $update_slack_bot_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/src/Api/AITaskManagementApi.php b/src/Api/AITaskManagementApi.php index 708b5b99..fe39cb40 100644 --- a/src/Api/AITaskManagementApi.php +++ b/src/Api/AITaskManagementApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/AIToolsApi.php b/src/Api/AIToolsApi.php index 4e194608..35660d98 100644 --- a/src/Api/AIToolsApi.php +++ b/src/Api/AIToolsApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -140,7 +140,7 @@ public function getConfig() /** * Operation getAIOrchestrationStatus * - * Get Orchestration Status + * Get Tool Orchestration Status (Async Tool Polling) * * @param string $organisation The organisation ID (required) * @param string $orchestration_id Orchestration identifier for aggregated async tool executions (required) @@ -159,7 +159,7 @@ public function getAIOrchestrationStatus($organisation, $orchestration_id, strin /** * Operation getAIOrchestrationStatusWithHttpInfo * - * Get Orchestration Status + * Get Tool Orchestration Status (Async Tool Polling) * * @param string $organisation The organisation ID (required) * @param string $orchestration_id Orchestration identifier for aggregated async tool executions (required) @@ -259,7 +259,7 @@ public function getAIOrchestrationStatusWithHttpInfo($organisation, $orchestrati /** * Operation getAIOrchestrationStatusAsync * - * Get Orchestration Status + * Get Tool Orchestration Status (Async Tool Polling) * * @param string $organisation The organisation ID (required) * @param string $orchestration_id Orchestration identifier for aggregated async tool executions (required) @@ -281,7 +281,7 @@ function ($response) { /** * Operation getAIOrchestrationStatusAsyncWithHttpInfo * - * Get Orchestration Status + * Get Tool Orchestration Status (Async Tool Polling) * * @param string $organisation The organisation ID (required) * @param string $orchestration_id Orchestration identifier for aggregated async tool executions (required) diff --git a/src/Api/AIMonitoringApi.php b/src/Api/AIUsageApi.php similarity index 79% rename from src/Api/AIMonitoringApi.php rename to src/Api/AIUsageApi.php index 7a9137d9..dae79ad3 100644 --- a/src/Api/AIMonitoringApi.php +++ b/src/Api/AIUsageApi.php @@ -1,6 +1,6 @@ [ + 'getMyUsage' => [ 'application/json', ], ]; @@ -126,40 +126,38 @@ public function getConfig() } /** - * Operation getAIUsageStats + * Operation getMyUsage * - * Get AI usage statistics + * Get AI usage summary for the authenticated user * * @param string $organisation The organisation ID (required) - * @param string|null $month Month to retrieve statistics for (YYYY-MM format) (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIUsageStats'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMyUsage'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \QuantClient\Model\GetAIUsageStats200Response + * @return \QuantClient\Model\GetMyUsage200Response */ - public function getAIUsageStats($organisation, $month = null, string $contentType = self::contentTypes['getAIUsageStats'][0]) + public function getMyUsage($organisation, string $contentType = self::contentTypes['getMyUsage'][0]) { - list($response) = $this->getAIUsageStatsWithHttpInfo($organisation, $month, $contentType); + list($response) = $this->getMyUsageWithHttpInfo($organisation, $contentType); return $response; } /** - * Operation getAIUsageStatsWithHttpInfo + * Operation getMyUsageWithHttpInfo * - * Get AI usage statistics + * Get AI usage summary for the authenticated user * * @param string $organisation The organisation ID (required) - * @param string|null $month Month to retrieve statistics for (YYYY-MM format) (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIUsageStats'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMyUsage'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \QuantClient\Model\GetAIUsageStats200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \QuantClient\Model\GetMyUsage200Response, HTTP status code, HTTP response headers (array of strings) */ - public function getAIUsageStatsWithHttpInfo($organisation, $month = null, string $contentType = self::contentTypes['getAIUsageStats'][0]) + public function getMyUsageWithHttpInfo($organisation, string $contentType = self::contentTypes['getMyUsage'][0]) { - $request = $this->getAIUsageStatsRequest($organisation, $month, $contentType); + $request = $this->getMyUsageRequest($organisation, $contentType); try { $options = $this->createHttpClientOption(); @@ -187,7 +185,7 @@ public function getAIUsageStatsWithHttpInfo($organisation, $month = null, string switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\QuantClient\Model\GetAIUsageStats200Response', + '\QuantClient\Model\GetMyUsage200Response', $request, $response, ); @@ -209,7 +207,7 @@ public function getAIUsageStatsWithHttpInfo($organisation, $month = null, string } return $this->handleResponseWithDataType( - '\QuantClient\Model\GetAIUsageStats200Response', + '\QuantClient\Model\GetMyUsage200Response', $request, $response, ); @@ -218,7 +216,7 @@ public function getAIUsageStatsWithHttpInfo($organisation, $month = null, string case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\QuantClient\Model\GetAIUsageStats200Response', + '\QuantClient\Model\GetMyUsage200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -231,20 +229,19 @@ public function getAIUsageStatsWithHttpInfo($organisation, $month = null, string } /** - * Operation getAIUsageStatsAsync + * Operation getMyUsageAsync * - * Get AI usage statistics + * Get AI usage summary for the authenticated user * * @param string $organisation The organisation ID (required) - * @param string|null $month Month to retrieve statistics for (YYYY-MM format) (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIUsageStats'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMyUsage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAIUsageStatsAsync($organisation, $month = null, string $contentType = self::contentTypes['getAIUsageStats'][0]) + public function getMyUsageAsync($organisation, string $contentType = self::contentTypes['getMyUsage'][0]) { - return $this->getAIUsageStatsAsyncWithHttpInfo($organisation, $month, $contentType) + return $this->getMyUsageAsyncWithHttpInfo($organisation, $contentType) ->then( function ($response) { return $response[0]; @@ -253,21 +250,20 @@ function ($response) { } /** - * Operation getAIUsageStatsAsyncWithHttpInfo + * Operation getMyUsageAsyncWithHttpInfo * - * Get AI usage statistics + * Get AI usage summary for the authenticated user * * @param string $organisation The organisation ID (required) - * @param string|null $month Month to retrieve statistics for (YYYY-MM format) (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIUsageStats'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMyUsage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAIUsageStatsAsyncWithHttpInfo($organisation, $month = null, string $contentType = self::contentTypes['getAIUsageStats'][0]) + public function getMyUsageAsyncWithHttpInfo($organisation, string $contentType = self::contentTypes['getMyUsage'][0]) { - $returnType = '\QuantClient\Model\GetAIUsageStats200Response'; - $request = $this->getAIUsageStatsRequest($organisation, $month, $contentType); + $returnType = '\QuantClient\Model\GetMyUsage200Response'; + $request = $this->getMyUsageRequest($organisation, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -306,43 +302,32 @@ function ($exception) { } /** - * Create request for operation 'getAIUsageStats' + * Create request for operation 'getMyUsage' * * @param string $organisation The organisation ID (required) - * @param string|null $month Month to retrieve statistics for (YYYY-MM format) (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAIUsageStats'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMyUsage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getAIUsageStatsRequest($organisation, $month = null, string $contentType = self::contentTypes['getAIUsageStats'][0]) + public function getMyUsageRequest($organisation, string $contentType = self::contentTypes['getMyUsage'][0]) { // verify the required parameter 'organisation' is set if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $organisation when calling getAIUsageStats' + 'Missing the required parameter $organisation when calling getMyUsage' ); } - - $resourcePath = '/api/v3/organizations/{organisation}/ai/usage'; + $resourcePath = '/api/v3/organizations/{organisation}/ai/usage/me'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $month, - 'month', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); // path params diff --git a/src/Api/AIVectorDatabaseApi.php b/src/Api/AIVectorDatabaseApi.php index c80bd13b..0332c87b 100644 --- a/src/Api/AIVectorDatabaseApi.php +++ b/src/Api/AIVectorDatabaseApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -80,12 +80,18 @@ class AIVectorDatabaseApi 'deleteVectorCollection' => [ 'application/json', ], + 'deleteVectorDocuments' => [ + 'application/json', + ], 'getVectorCollection' => [ 'application/json', ], 'listVectorCollections' => [ 'application/json', ], + 'listVectorDocuments' => [ + 'application/json', + ], 'queryVectorCollection' => [ 'application/json', ], @@ -442,7 +448,7 @@ public function createVectorCollectionRequest($organisation, $create_vector_coll * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \QuantClient\Model\DeleteVectorCollection200Response + * @return \QuantClient\Model\DeleteSkillCollection200Response */ public function deleteVectorCollection($organisation, $collection_id, string $contentType = self::contentTypes['deleteVectorCollection'][0]) { @@ -461,7 +467,7 @@ public function deleteVectorCollection($organisation, $collection_id, string $co * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \QuantClient\Model\DeleteVectorCollection200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \QuantClient\Model\DeleteSkillCollection200Response, HTTP status code, HTTP response headers (array of strings) */ public function deleteVectorCollectionWithHttpInfo($organisation, $collection_id, string $contentType = self::contentTypes['deleteVectorCollection'][0]) { @@ -493,7 +499,7 @@ public function deleteVectorCollectionWithHttpInfo($organisation, $collection_id switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\QuantClient\Model\DeleteVectorCollection200Response', + '\QuantClient\Model\DeleteSkillCollection200Response', $request, $response, ); @@ -515,7 +521,7 @@ public function deleteVectorCollectionWithHttpInfo($organisation, $collection_id } return $this->handleResponseWithDataType( - '\QuantClient\Model\DeleteVectorCollection200Response', + '\QuantClient\Model\DeleteSkillCollection200Response', $request, $response, ); @@ -524,7 +530,7 @@ public function deleteVectorCollectionWithHttpInfo($organisation, $collection_id case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\QuantClient\Model\DeleteVectorCollection200Response', + '\QuantClient\Model\DeleteSkillCollection200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -572,7 +578,7 @@ function ($response) { */ public function deleteVectorCollectionAsyncWithHttpInfo($organisation, $collection_id, string $contentType = self::contentTypes['deleteVectorCollection'][0]) { - $returnType = '\QuantClient\Model\DeleteVectorCollection200Response'; + $returnType = '\QuantClient\Model\DeleteSkillCollection200Response'; $request = $this->deleteVectorCollectionRequest($organisation, $collection_id, $contentType); return $this->client @@ -723,6 +729,317 @@ public function deleteVectorCollectionRequest($organisation, $collection_id, str ); } + /** + * Operation deleteVectorDocuments + * + * Delete Documents from Collection + * + * @param string $organisation Organisation machine name (required) + * @param string $collection_id Collection UUID (required) + * @param \QuantClient\Model\DeleteVectorDocumentsRequest $delete_vector_documents_request delete_vector_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteVectorDocuments'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\DeleteVectorDocuments200Response + */ + public function deleteVectorDocuments($organisation, $collection_id, $delete_vector_documents_request, string $contentType = self::contentTypes['deleteVectorDocuments'][0]) + { + list($response) = $this->deleteVectorDocumentsWithHttpInfo($organisation, $collection_id, $delete_vector_documents_request, $contentType); + return $response; + } + + /** + * Operation deleteVectorDocumentsWithHttpInfo + * + * Delete Documents from Collection + * + * @param string $organisation Organisation machine name (required) + * @param string $collection_id Collection UUID (required) + * @param \QuantClient\Model\DeleteVectorDocumentsRequest $delete_vector_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteVectorDocuments'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\DeleteVectorDocuments200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteVectorDocumentsWithHttpInfo($organisation, $collection_id, $delete_vector_documents_request, string $contentType = self::contentTypes['deleteVectorDocuments'][0]) + { + $request = $this->deleteVectorDocumentsRequest($organisation, $collection_id, $delete_vector_documents_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\DeleteVectorDocuments200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\DeleteVectorDocuments200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\DeleteVectorDocuments200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation deleteVectorDocumentsAsync + * + * Delete Documents from Collection + * + * @param string $organisation Organisation machine name (required) + * @param string $collection_id Collection UUID (required) + * @param \QuantClient\Model\DeleteVectorDocumentsRequest $delete_vector_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteVectorDocuments'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteVectorDocumentsAsync($organisation, $collection_id, $delete_vector_documents_request, string $contentType = self::contentTypes['deleteVectorDocuments'][0]) + { + return $this->deleteVectorDocumentsAsyncWithHttpInfo($organisation, $collection_id, $delete_vector_documents_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteVectorDocumentsAsyncWithHttpInfo + * + * Delete Documents from Collection + * + * @param string $organisation Organisation machine name (required) + * @param string $collection_id Collection UUID (required) + * @param \QuantClient\Model\DeleteVectorDocumentsRequest $delete_vector_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteVectorDocuments'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteVectorDocumentsAsyncWithHttpInfo($organisation, $collection_id, $delete_vector_documents_request, string $contentType = self::contentTypes['deleteVectorDocuments'][0]) + { + $returnType = '\QuantClient\Model\DeleteVectorDocuments200Response'; + $request = $this->deleteVectorDocumentsRequest($organisation, $collection_id, $delete_vector_documents_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteVectorDocuments' + * + * @param string $organisation Organisation machine name (required) + * @param string $collection_id Collection UUID (required) + * @param \QuantClient\Model\DeleteVectorDocumentsRequest $delete_vector_documents_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteVectorDocuments'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteVectorDocumentsRequest($organisation, $collection_id, $delete_vector_documents_request, string $contentType = self::contentTypes['deleteVectorDocuments'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling deleteVectorDocuments' + ); + } + + // verify the required parameter 'collection_id' is set + if ($collection_id === null || (is_array($collection_id) && count($collection_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $collection_id when calling deleteVectorDocuments' + ); + } + + // verify the required parameter 'delete_vector_documents_request' is set + if ($delete_vector_documents_request === null || (is_array($delete_vector_documents_request) && count($delete_vector_documents_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $delete_vector_documents_request when calling deleteVectorDocuments' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId}/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($collection_id !== null) { + $resourcePath = str_replace( + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collection_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($delete_vector_documents_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_vector_documents_request)); + } else { + $httpBody = $delete_vector_documents_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation getVectorCollection * @@ -1287,6 +1604,296 @@ public function listVectorCollectionsRequest($organisation, string $contentType ); } + /** + * Operation listVectorDocuments + * + * List Documents in Collection + * + * @param string $organisation organisation (required) + * @param string $collection_id collection_id (required) + * @param string|null $key Filter by document key (optional) + * @param int|null $limit limit (optional, default to 50) + * @param int|null $offset offset (optional, default to 0) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listVectorDocuments'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function listVectorDocuments($organisation, $collection_id, $key = null, $limit = 50, $offset = 0, string $contentType = self::contentTypes['listVectorDocuments'][0]) + { + $this->listVectorDocumentsWithHttpInfo($organisation, $collection_id, $key, $limit, $offset, $contentType); + } + + /** + * Operation listVectorDocumentsWithHttpInfo + * + * List Documents in Collection + * + * @param string $organisation (required) + * @param string $collection_id (required) + * @param string|null $key Filter by document key (optional) + * @param int|null $limit (optional, default to 50) + * @param int|null $offset (optional, default to 0) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listVectorDocuments'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function listVectorDocumentsWithHttpInfo($organisation, $collection_id, $key = null, $limit = 50, $offset = 0, string $contentType = self::contentTypes['listVectorDocuments'][0]) + { + $request = $this->listVectorDocumentsRequest($organisation, $collection_id, $key, $limit, $offset, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation listVectorDocumentsAsync + * + * List Documents in Collection + * + * @param string $organisation (required) + * @param string $collection_id (required) + * @param string|null $key Filter by document key (optional) + * @param int|null $limit (optional, default to 50) + * @param int|null $offset (optional, default to 0) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listVectorDocuments'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listVectorDocumentsAsync($organisation, $collection_id, $key = null, $limit = 50, $offset = 0, string $contentType = self::contentTypes['listVectorDocuments'][0]) + { + return $this->listVectorDocumentsAsyncWithHttpInfo($organisation, $collection_id, $key, $limit, $offset, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listVectorDocumentsAsyncWithHttpInfo + * + * List Documents in Collection + * + * @param string $organisation (required) + * @param string $collection_id (required) + * @param string|null $key Filter by document key (optional) + * @param int|null $limit (optional, default to 50) + * @param int|null $offset (optional, default to 0) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listVectorDocuments'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listVectorDocumentsAsyncWithHttpInfo($organisation, $collection_id, $key = null, $limit = 50, $offset = 0, string $contentType = self::contentTypes['listVectorDocuments'][0]) + { + $returnType = ''; + $request = $this->listVectorDocumentsRequest($organisation, $collection_id, $key, $limit, $offset, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listVectorDocuments' + * + * @param string $organisation (required) + * @param string $collection_id (required) + * @param string|null $key Filter by document key (optional) + * @param int|null $limit (optional, default to 50) + * @param int|null $offset (optional, default to 0) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listVectorDocuments'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listVectorDocumentsRequest($organisation, $collection_id, $key = null, $limit = 50, $offset = 0, string $contentType = self::contentTypes['listVectorDocuments'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling listVectorDocuments' + ); + } + + // verify the required parameter 'collection_id' is set + if ($collection_id === null || (is_array($collection_id) && count($collection_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $collection_id when calling listVectorDocuments' + ); + } + + + if ($limit !== null && $limit > 100) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling AIVectorDatabaseApi.listVectorDocuments, must be smaller than or equal to 100.'); + } + + + + $resourcePath = '/api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId}/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $key, + 'key', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $offset, + 'offset', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($collection_id !== null) { + $resourcePath = str_replace( + '{' . 'collectionId' . '}', + ObjectSerializer::toPathValue($collection_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation queryVectorCollection * diff --git a/src/Api/ApplicationsApi.php b/src/Api/ApplicationsApi.php index eaf6b392..8b19d40b 100644 --- a/src/Api/ApplicationsApi.php +++ b/src/Api/ApplicationsApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/BackupManagementApi.php b/src/Api/BackupManagementApi.php index a6e02e15..5cfdcf7e 100644 --- a/src/Api/BackupManagementApi.php +++ b/src/Api/BackupManagementApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/CDNMetricsApi.php b/src/Api/CDNMetricsApi.php new file mode 100644 index 00000000..8fa17204 --- /dev/null +++ b/src/Api/CDNMetricsApi.php @@ -0,0 +1,1206 @@ + [ + 'application/json', + ], + 'getHourlyMetrics' => [ + 'application/json', + ], + 'getMonthlyMetrics' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getDailyMetrics + * + * Get daily metrics + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string|null $domain Filter by domain ID or domain name (optional) + * @param string[]|null $metrics Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. (optional) + * @param string|null $timestamp_format Timestamp format in response (optional, default to 'iso8601') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDailyMetrics'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\V2MetricsResponse + */ + public function getDailyMetrics($organization, $project, $domain = null, $metrics = null, $timestamp_format = 'iso8601', string $contentType = self::contentTypes['getDailyMetrics'][0]) + { + list($response) = $this->getDailyMetricsWithHttpInfo($organization, $project, $domain, $metrics, $timestamp_format, $contentType); + return $response; + } + + /** + * Operation getDailyMetricsWithHttpInfo + * + * Get daily metrics + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string|null $domain Filter by domain ID or domain name (optional) + * @param string[]|null $metrics Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. (optional) + * @param string|null $timestamp_format Timestamp format in response (optional, default to 'iso8601') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDailyMetrics'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\V2MetricsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDailyMetricsWithHttpInfo($organization, $project, $domain = null, $metrics = null, $timestamp_format = 'iso8601', string $contentType = self::contentTypes['getDailyMetrics'][0]) + { + $request = $this->getDailyMetricsRequest($organization, $project, $domain, $metrics, $timestamp_format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2MetricsResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2MetricsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\V2MetricsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getDailyMetricsAsync + * + * Get daily metrics + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string|null $domain Filter by domain ID or domain name (optional) + * @param string[]|null $metrics Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. (optional) + * @param string|null $timestamp_format Timestamp format in response (optional, default to 'iso8601') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDailyMetrics'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDailyMetricsAsync($organization, $project, $domain = null, $metrics = null, $timestamp_format = 'iso8601', string $contentType = self::contentTypes['getDailyMetrics'][0]) + { + return $this->getDailyMetricsAsyncWithHttpInfo($organization, $project, $domain, $metrics, $timestamp_format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDailyMetricsAsyncWithHttpInfo + * + * Get daily metrics + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string|null $domain Filter by domain ID or domain name (optional) + * @param string[]|null $metrics Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. (optional) + * @param string|null $timestamp_format Timestamp format in response (optional, default to 'iso8601') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDailyMetrics'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDailyMetricsAsyncWithHttpInfo($organization, $project, $domain = null, $metrics = null, $timestamp_format = 'iso8601', string $contentType = self::contentTypes['getDailyMetrics'][0]) + { + $returnType = '\QuantClient\Model\V2MetricsResponse'; + $request = $this->getDailyMetricsRequest($organization, $project, $domain, $metrics, $timestamp_format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDailyMetrics' + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string|null $domain Filter by domain ID or domain name (optional) + * @param string[]|null $metrics Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. (optional) + * @param string|null $timestamp_format Timestamp format in response (optional, default to 'iso8601') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDailyMetrics'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDailyMetricsRequest($organization, $project, $domain = null, $metrics = null, $timestamp_format = 'iso8601', string $contentType = self::contentTypes['getDailyMetrics'][0]) + { + + // verify the required parameter 'organization' is set + if ($organization === null || (is_array($organization) && count($organization) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organization when calling getDailyMetrics' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling getDailyMetrics' + ); + } + + + + + + $resourcePath = '/v2/organizations/{organization}/projects/{project}/metrics/daily'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $domain, + 'domain', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $metrics, + 'metrics[]', // param base name + 'array', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_format, + 'timestamp_format', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organization !== null) { + $resourcePath = str_replace( + '{' . 'organization' . '}', + ObjectSerializer::toPathValue($organization), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getHourlyMetrics + * + * Get hourly metrics + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string|null $domain Filter by domain ID or domain name (optional) + * @param string[]|null $metrics Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. (optional) + * @param string|null $timestamp_format Timestamp format in response (optional, default to 'iso8601') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHourlyMetrics'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\V2MetricsResponse + */ + public function getHourlyMetrics($organization, $project, $domain = null, $metrics = null, $timestamp_format = 'iso8601', string $contentType = self::contentTypes['getHourlyMetrics'][0]) + { + list($response) = $this->getHourlyMetricsWithHttpInfo($organization, $project, $domain, $metrics, $timestamp_format, $contentType); + return $response; + } + + /** + * Operation getHourlyMetricsWithHttpInfo + * + * Get hourly metrics + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string|null $domain Filter by domain ID or domain name (optional) + * @param string[]|null $metrics Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. (optional) + * @param string|null $timestamp_format Timestamp format in response (optional, default to 'iso8601') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHourlyMetrics'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\V2MetricsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getHourlyMetricsWithHttpInfo($organization, $project, $domain = null, $metrics = null, $timestamp_format = 'iso8601', string $contentType = self::contentTypes['getHourlyMetrics'][0]) + { + $request = $this->getHourlyMetricsRequest($organization, $project, $domain, $metrics, $timestamp_format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2MetricsResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2MetricsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\V2MetricsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getHourlyMetricsAsync + * + * Get hourly metrics + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string|null $domain Filter by domain ID or domain name (optional) + * @param string[]|null $metrics Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. (optional) + * @param string|null $timestamp_format Timestamp format in response (optional, default to 'iso8601') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHourlyMetrics'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getHourlyMetricsAsync($organization, $project, $domain = null, $metrics = null, $timestamp_format = 'iso8601', string $contentType = self::contentTypes['getHourlyMetrics'][0]) + { + return $this->getHourlyMetricsAsyncWithHttpInfo($organization, $project, $domain, $metrics, $timestamp_format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getHourlyMetricsAsyncWithHttpInfo + * + * Get hourly metrics + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string|null $domain Filter by domain ID or domain name (optional) + * @param string[]|null $metrics Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. (optional) + * @param string|null $timestamp_format Timestamp format in response (optional, default to 'iso8601') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHourlyMetrics'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getHourlyMetricsAsyncWithHttpInfo($organization, $project, $domain = null, $metrics = null, $timestamp_format = 'iso8601', string $contentType = self::contentTypes['getHourlyMetrics'][0]) + { + $returnType = '\QuantClient\Model\V2MetricsResponse'; + $request = $this->getHourlyMetricsRequest($organization, $project, $domain, $metrics, $timestamp_format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getHourlyMetrics' + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string|null $domain Filter by domain ID or domain name (optional) + * @param string[]|null $metrics Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. (optional) + * @param string|null $timestamp_format Timestamp format in response (optional, default to 'iso8601') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getHourlyMetrics'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getHourlyMetricsRequest($organization, $project, $domain = null, $metrics = null, $timestamp_format = 'iso8601', string $contentType = self::contentTypes['getHourlyMetrics'][0]) + { + + // verify the required parameter 'organization' is set + if ($organization === null || (is_array($organization) && count($organization) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organization when calling getHourlyMetrics' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling getHourlyMetrics' + ); + } + + + + + + $resourcePath = '/v2/organizations/{organization}/projects/{project}/metrics/hourly'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $domain, + 'domain', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $metrics, + 'metrics[]', // param base name + 'array', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_format, + 'timestamp_format', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organization !== null) { + $resourcePath = str_replace( + '{' . 'organization' . '}', + ObjectSerializer::toPathValue($organization), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getMonthlyMetrics + * + * Get monthly metrics + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string|null $domain Filter by domain ID or domain name (optional) + * @param string[]|null $metrics Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. (optional) + * @param string|null $timestamp_format Timestamp format in response (optional, default to 'iso8601') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMonthlyMetrics'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\V2MetricsResponse + */ + public function getMonthlyMetrics($organization, $project, $domain = null, $metrics = null, $timestamp_format = 'iso8601', string $contentType = self::contentTypes['getMonthlyMetrics'][0]) + { + list($response) = $this->getMonthlyMetricsWithHttpInfo($organization, $project, $domain, $metrics, $timestamp_format, $contentType); + return $response; + } + + /** + * Operation getMonthlyMetricsWithHttpInfo + * + * Get monthly metrics + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string|null $domain Filter by domain ID or domain name (optional) + * @param string[]|null $metrics Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. (optional) + * @param string|null $timestamp_format Timestamp format in response (optional, default to 'iso8601') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMonthlyMetrics'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\V2MetricsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getMonthlyMetricsWithHttpInfo($organization, $project, $domain = null, $metrics = null, $timestamp_format = 'iso8601', string $contentType = self::contentTypes['getMonthlyMetrics'][0]) + { + $request = $this->getMonthlyMetricsRequest($organization, $project, $domain, $metrics, $timestamp_format, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2MetricsResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2MetricsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\V2MetricsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getMonthlyMetricsAsync + * + * Get monthly metrics + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string|null $domain Filter by domain ID or domain name (optional) + * @param string[]|null $metrics Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. (optional) + * @param string|null $timestamp_format Timestamp format in response (optional, default to 'iso8601') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMonthlyMetrics'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMonthlyMetricsAsync($organization, $project, $domain = null, $metrics = null, $timestamp_format = 'iso8601', string $contentType = self::contentTypes['getMonthlyMetrics'][0]) + { + return $this->getMonthlyMetricsAsyncWithHttpInfo($organization, $project, $domain, $metrics, $timestamp_format, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMonthlyMetricsAsyncWithHttpInfo + * + * Get monthly metrics + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string|null $domain Filter by domain ID or domain name (optional) + * @param string[]|null $metrics Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. (optional) + * @param string|null $timestamp_format Timestamp format in response (optional, default to 'iso8601') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMonthlyMetrics'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMonthlyMetricsAsyncWithHttpInfo($organization, $project, $domain = null, $metrics = null, $timestamp_format = 'iso8601', string $contentType = self::contentTypes['getMonthlyMetrics'][0]) + { + $returnType = '\QuantClient\Model\V2MetricsResponse'; + $request = $this->getMonthlyMetricsRequest($organization, $project, $domain, $metrics, $timestamp_format, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMonthlyMetrics' + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string|null $domain Filter by domain ID or domain name (optional) + * @param string[]|null $metrics Metrics to return (default: hits, bytes). Use the /metrics/available endpoint to list all metrics by category. (optional) + * @param string|null $timestamp_format Timestamp format in response (optional, default to 'iso8601') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMonthlyMetrics'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getMonthlyMetricsRequest($organization, $project, $domain = null, $metrics = null, $timestamp_format = 'iso8601', string $contentType = self::contentTypes['getMonthlyMetrics'][0]) + { + + // verify the required parameter 'organization' is set + if ($organization === null || (is_array($organization) && count($organization) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organization when calling getMonthlyMetrics' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling getMonthlyMetrics' + ); + } + + + + + + $resourcePath = '/v2/organizations/{organization}/projects/{project}/metrics/monthly'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $domain, + 'domain', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $metrics, + 'metrics[]', // param base name + 'array', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timestamp_format, + 'timestamp_format', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organization !== null) { + $resourcePath = str_replace( + '{' . 'organization' . '}', + ObjectSerializer::toPathValue($organization), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/src/Api/CommandsApi.php b/src/Api/CommandsApi.php index 3b1ec6d1..3d33d0a7 100644 --- a/src/Api/CommandsApi.php +++ b/src/Api/CommandsApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/ComposeApi.php b/src/Api/ComposeApi.php index 66751422..b0b921dc 100644 --- a/src/Api/ComposeApi.php +++ b/src/Api/ComposeApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/ContainersApi.php b/src/Api/ContainersApi.php index fc6c4a63..906af9ed 100644 --- a/src/Api/ContainersApi.php +++ b/src/Api/ContainersApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/CrawlerSchedulesApi.php b/src/Api/CrawlerSchedulesApi.php index 115c4bce..17b72e11 100644 --- a/src/Api/CrawlerSchedulesApi.php +++ b/src/Api/CrawlerSchedulesApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/CrawlersApi.php b/src/Api/CrawlersApi.php index f60f8919..ec6ee830 100644 --- a/src/Api/CrawlersApi.php +++ b/src/Api/CrawlersApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/CronApi.php b/src/Api/CronApi.php index d9e722e1..b59a6c7e 100644 --- a/src/Api/CronApi.php +++ b/src/Api/CronApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/DomainsApi.php b/src/Api/DomainsApi.php index c2775d81..f9874b16 100644 --- a/src/Api/DomainsApi.php +++ b/src/Api/DomainsApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/EnvironmentsApi.php b/src/Api/EnvironmentsApi.php index 889de3bf..fe959bb9 100644 --- a/src/Api/EnvironmentsApi.php +++ b/src/Api/EnvironmentsApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/HeadersApi.php b/src/Api/HeadersApi.php index 2848346e..505414b0 100644 --- a/src/Api/HeadersApi.php +++ b/src/Api/HeadersApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/KVApi.php b/src/Api/KVApi.php index e4344637..a86f1b59 100644 --- a/src/Api/KVApi.php +++ b/src/Api/KVApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -95,12 +95,18 @@ class KVApi 'kVItemsUpdate' => [ 'application/json', ], + 'kVLinkToProject' => [ + 'application/json', + ], 'kVList' => [ 'application/json', ], 'kVShow' => [ 'application/json', ], + 'kVUnlinkFromProject' => [ + 'application/json', + ], ]; /** @@ -2653,40 +2659,44 @@ public function kVItemsUpdateRequest($organization, $project, $store_id, $key, $ } /** - * Operation kVList + * Operation kVLinkToProject * - * List key-value stores + * Link a KV store to another project * * @param string $organization Organization identifier (required) - * @param string $project Project identifier (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVList'] to see the possible values for this operation + * @param string $project Source project identifier (required) + * @param string $store_id KV store identifier (required) + * @param \QuantClient\Model\KVLinkToProjectRequest $kv_link_to_project_request kv_link_to_project_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVLinkToProject'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \QuantClient\Model\V2Store[]|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error + * @return \QuantClient\Model\KVLinkToProject200Response|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error */ - public function kVList($organization, $project, string $contentType = self::contentTypes['kVList'][0]) + public function kVLinkToProject($organization, $project, $store_id, $kv_link_to_project_request, string $contentType = self::contentTypes['kVLinkToProject'][0]) { - list($response) = $this->kVListWithHttpInfo($organization, $project, $contentType); + list($response) = $this->kVLinkToProjectWithHttpInfo($organization, $project, $store_id, $kv_link_to_project_request, $contentType); return $response; } /** - * Operation kVListWithHttpInfo + * Operation kVLinkToProjectWithHttpInfo * - * List key-value stores + * Link a KV store to another project * * @param string $organization Organization identifier (required) - * @param string $project Project identifier (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVList'] to see the possible values for this operation + * @param string $project Source project identifier (required) + * @param string $store_id KV store identifier (required) + * @param \QuantClient\Model\KVLinkToProjectRequest $kv_link_to_project_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVLinkToProject'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \QuantClient\Model\V2Store[]|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \QuantClient\Model\KVLinkToProject200Response|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error, HTTP status code, HTTP response headers (array of strings) */ - public function kVListWithHttpInfo($organization, $project, string $contentType = self::contentTypes['kVList'][0]) + public function kVLinkToProjectWithHttpInfo($organization, $project, $store_id, $kv_link_to_project_request, string $contentType = self::contentTypes['kVLinkToProject'][0]) { - $request = $this->kVListRequest($organization, $project, $contentType); + $request = $this->kVLinkToProjectRequest($organization, $project, $store_id, $kv_link_to_project_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -2714,7 +2724,7 @@ public function kVListWithHttpInfo($organization, $project, string $contentType switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\QuantClient\Model\V2Store[]', + '\QuantClient\Model\KVLinkToProject200Response', $request, $response, ); @@ -2724,6 +2734,12 @@ public function kVListWithHttpInfo($organization, $project, string $contentType $request, $response, ); + case 404: + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2Error', + $request, + $response, + ); case 403: return $this->handleResponseWithDataType( '\QuantClient\Model\V2Error', @@ -2748,7 +2764,7 @@ public function kVListWithHttpInfo($organization, $project, string $contentType } return $this->handleResponseWithDataType( - '\QuantClient\Model\V2Store[]', + '\QuantClient\Model\KVLinkToProject200Response', $request, $response, ); @@ -2757,7 +2773,7 @@ public function kVListWithHttpInfo($organization, $project, string $contentType case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\QuantClient\Model\V2Store[]', + '\QuantClient\Model\KVLinkToProject200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2770,6 +2786,14 @@ public function kVListWithHttpInfo($organization, $project, string $contentType ); $e->setResponseObject($data); throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\V2Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2786,20 +2810,22 @@ public function kVListWithHttpInfo($organization, $project, string $contentType } /** - * Operation kVListAsync + * Operation kVLinkToProjectAsync * - * List key-value stores + * Link a KV store to another project * * @param string $organization Organization identifier (required) - * @param string $project Project identifier (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVList'] to see the possible values for this operation + * @param string $project Source project identifier (required) + * @param string $store_id KV store identifier (required) + * @param \QuantClient\Model\KVLinkToProjectRequest $kv_link_to_project_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVLinkToProject'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function kVListAsync($organization, $project, string $contentType = self::contentTypes['kVList'][0]) + public function kVLinkToProjectAsync($organization, $project, $store_id, $kv_link_to_project_request, string $contentType = self::contentTypes['kVLinkToProject'][0]) { - return $this->kVListAsyncWithHttpInfo($organization, $project, $contentType) + return $this->kVLinkToProjectAsyncWithHttpInfo($organization, $project, $store_id, $kv_link_to_project_request, $contentType) ->then( function ($response) { return $response[0]; @@ -2808,21 +2834,23 @@ function ($response) { } /** - * Operation kVListAsyncWithHttpInfo + * Operation kVLinkToProjectAsyncWithHttpInfo * - * List key-value stores + * Link a KV store to another project * * @param string $organization Organization identifier (required) - * @param string $project Project identifier (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVList'] to see the possible values for this operation + * @param string $project Source project identifier (required) + * @param string $store_id KV store identifier (required) + * @param \QuantClient\Model\KVLinkToProjectRequest $kv_link_to_project_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVLinkToProject'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function kVListAsyncWithHttpInfo($organization, $project, string $contentType = self::contentTypes['kVList'][0]) + public function kVLinkToProjectAsyncWithHttpInfo($organization, $project, $store_id, $kv_link_to_project_request, string $contentType = self::contentTypes['kVLinkToProject'][0]) { - $returnType = '\QuantClient\Model\V2Store[]'; - $request = $this->kVListRequest($organization, $project, $contentType); + $returnType = '\QuantClient\Model\KVLinkToProject200Response'; + $request = $this->kVLinkToProjectRequest($organization, $project, $store_id, $kv_link_to_project_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2861,34 +2889,50 @@ function ($exception) { } /** - * Create request for operation 'kVList' + * Create request for operation 'kVLinkToProject' * * @param string $organization Organization identifier (required) - * @param string $project Project identifier (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVList'] to see the possible values for this operation + * @param string $project Source project identifier (required) + * @param string $store_id KV store identifier (required) + * @param \QuantClient\Model\KVLinkToProjectRequest $kv_link_to_project_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVLinkToProject'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function kVListRequest($organization, $project, string $contentType = self::contentTypes['kVList'][0]) + public function kVLinkToProjectRequest($organization, $project, $store_id, $kv_link_to_project_request, string $contentType = self::contentTypes['kVLinkToProject'][0]) { // verify the required parameter 'organization' is set if ($organization === null || (is_array($organization) && count($organization) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $organization when calling kVList' + 'Missing the required parameter $organization when calling kVLinkToProject' ); } // verify the required parameter 'project' is set if ($project === null || (is_array($project) && count($project) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $project when calling kVList' + 'Missing the required parameter $project when calling kVLinkToProject' + ); + } + + // verify the required parameter 'store_id' is set + if ($store_id === null || (is_array($store_id) && count($store_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $store_id when calling kVLinkToProject' ); } + // verify the required parameter 'kv_link_to_project_request' is set + if ($kv_link_to_project_request === null || (is_array($kv_link_to_project_request) && count($kv_link_to_project_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $kv_link_to_project_request when calling kVLinkToProject' + ); + } - $resourcePath = '/api/v2/organizations/{organization}/projects/{project}/kv'; + + $resourcePath = '/api/v2/organizations/{organization}/projects/{project}/kv/{store_id}/link'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2913,6 +2957,14 @@ public function kVListRequest($organization, $project, string $contentType = sel $resourcePath ); } + // path params + if ($store_id !== null) { + $resourcePath = str_replace( + '{' . 'store_id' . '}', + ObjectSerializer::toPathValue($store_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -2922,7 +2974,14 @@ public function kVListRequest($organization, $project, string $contentType = sel ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($kv_link_to_project_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($kv_link_to_project_request)); + } else { + $httpBody = $kv_link_to_project_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -2965,7 +3024,7 @@ public function kVListRequest($organization, $project, string $contentType = sel $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2973,42 +3032,40 @@ public function kVListRequest($organization, $project, string $contentType = sel } /** - * Operation kVShow + * Operation kVList * - * Get a kv store + * List key-value stores * * @param string $organization Organization identifier (required) * @param string $project Project identifier (required) - * @param string $store_id store_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVShow'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVList'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \QuantClient\Model\V2Store|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error + * @return \QuantClient\Model\V2Store[]|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error */ - public function kVShow($organization, $project, $store_id, string $contentType = self::contentTypes['kVShow'][0]) + public function kVList($organization, $project, string $contentType = self::contentTypes['kVList'][0]) { - list($response) = $this->kVShowWithHttpInfo($organization, $project, $store_id, $contentType); + list($response) = $this->kVListWithHttpInfo($organization, $project, $contentType); return $response; } /** - * Operation kVShowWithHttpInfo + * Operation kVListWithHttpInfo * - * Get a kv store + * List key-value stores * * @param string $organization Organization identifier (required) * @param string $project Project identifier (required) - * @param string $store_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVShow'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVList'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \QuantClient\Model\V2Store|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \QuantClient\Model\V2Store[]|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error, HTTP status code, HTTP response headers (array of strings) */ - public function kVShowWithHttpInfo($organization, $project, $store_id, string $contentType = self::contentTypes['kVShow'][0]) + public function kVListWithHttpInfo($organization, $project, string $contentType = self::contentTypes['kVList'][0]) { - $request = $this->kVShowRequest($organization, $project, $store_id, $contentType); + $request = $this->kVListRequest($organization, $project, $contentType); try { $options = $this->createHttpClientOption(); @@ -3036,11 +3093,11 @@ public function kVShowWithHttpInfo($organization, $project, $store_id, string $c switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\QuantClient\Model\V2Store', + '\QuantClient\Model\V2Store[]', $request, $response, ); - case 404: + case 400: return $this->handleResponseWithDataType( '\QuantClient\Model\V2Error', $request, @@ -3070,7 +3127,7 @@ public function kVShowWithHttpInfo($organization, $project, $store_id, string $c } return $this->handleResponseWithDataType( - '\QuantClient\Model\V2Store', + '\QuantClient\Model\V2Store[]', $request, $response, ); @@ -3079,12 +3136,12 @@ public function kVShowWithHttpInfo($organization, $project, $store_id, string $c case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\QuantClient\Model\V2Store', + '\QuantClient\Model\V2Store[]', $e->getResponseHeaders() ); $e->setResponseObject($data); throw $e; - case 404: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\QuantClient\Model\V2Error', @@ -3108,21 +3165,20 @@ public function kVShowWithHttpInfo($organization, $project, $store_id, string $c } /** - * Operation kVShowAsync + * Operation kVListAsync * - * Get a kv store + * List key-value stores * * @param string $organization Organization identifier (required) * @param string $project Project identifier (required) - * @param string $store_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVShow'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function kVShowAsync($organization, $project, $store_id, string $contentType = self::contentTypes['kVShow'][0]) + public function kVListAsync($organization, $project, string $contentType = self::contentTypes['kVList'][0]) { - return $this->kVShowAsyncWithHttpInfo($organization, $project, $store_id, $contentType) + return $this->kVListAsyncWithHttpInfo($organization, $project, $contentType) ->then( function ($response) { return $response[0]; @@ -3131,22 +3187,21 @@ function ($response) { } /** - * Operation kVShowAsyncWithHttpInfo + * Operation kVListAsyncWithHttpInfo * - * Get a kv store + * List key-value stores * * @param string $organization Organization identifier (required) * @param string $project Project identifier (required) - * @param string $store_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVShow'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function kVShowAsyncWithHttpInfo($organization, $project, $store_id, string $contentType = self::contentTypes['kVShow'][0]) + public function kVListAsyncWithHttpInfo($organization, $project, string $contentType = self::contentTypes['kVList'][0]) { - $returnType = '\QuantClient\Model\V2Store'; - $request = $this->kVShowRequest($organization, $project, $store_id, $contentType); + $returnType = '\QuantClient\Model\V2Store[]'; + $request = $this->kVListRequest($organization, $project, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3185,42 +3240,34 @@ function ($exception) { } /** - * Create request for operation 'kVShow' + * Create request for operation 'kVList' * * @param string $organization Organization identifier (required) * @param string $project Project identifier (required) - * @param string $store_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVShow'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function kVShowRequest($organization, $project, $store_id, string $contentType = self::contentTypes['kVShow'][0]) + public function kVListRequest($organization, $project, string $contentType = self::contentTypes['kVList'][0]) { // verify the required parameter 'organization' is set if ($organization === null || (is_array($organization) && count($organization) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $organization when calling kVShow' + 'Missing the required parameter $organization when calling kVList' ); } // verify the required parameter 'project' is set if ($project === null || (is_array($project) && count($project) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $project when calling kVShow' - ); - } - - // verify the required parameter 'store_id' is set - if ($store_id === null || (is_array($store_id) && count($store_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $store_id when calling kVShow' + 'Missing the required parameter $project when calling kVList' ); } - $resourcePath = '/api/v2/organizations/{organization}/projects/{project}/kv/{store_id}'; + $resourcePath = '/api/v2/organizations/{organization}/projects/{project}/kv'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3245,14 +3292,6 @@ public function kVShowRequest($organization, $project, $store_id, string $conten $resourcePath ); } - // path params - if ($store_id !== null) { - $resourcePath = str_replace( - '{' . 'store_id' . '}', - ObjectSerializer::toPathValue($store_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -3312,6 +3351,686 @@ public function kVShowRequest($organization, $project, $store_id, string $conten ); } + /** + * Operation kVShow + * + * Get a kv store + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string $store_id store_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVShow'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\V2Store|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error + */ + public function kVShow($organization, $project, $store_id, string $contentType = self::contentTypes['kVShow'][0]) + { + list($response) = $this->kVShowWithHttpInfo($organization, $project, $store_id, $contentType); + return $response; + } + + /** + * Operation kVShowWithHttpInfo + * + * Get a kv store + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string $store_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVShow'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\V2Store|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error, HTTP status code, HTTP response headers (array of strings) + */ + public function kVShowWithHttpInfo($organization, $project, $store_id, string $contentType = self::contentTypes['kVShow'][0]) + { + $request = $this->kVShowRequest($organization, $project, $store_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2Store', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2Error', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2Error', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2Store', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\V2Store', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\V2Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\V2Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation kVShowAsync + * + * Get a kv store + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string $store_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVShow'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function kVShowAsync($organization, $project, $store_id, string $contentType = self::contentTypes['kVShow'][0]) + { + return $this->kVShowAsyncWithHttpInfo($organization, $project, $store_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation kVShowAsyncWithHttpInfo + * + * Get a kv store + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string $store_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVShow'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function kVShowAsyncWithHttpInfo($organization, $project, $store_id, string $contentType = self::contentTypes['kVShow'][0]) + { + $returnType = '\QuantClient\Model\V2Store'; + $request = $this->kVShowRequest($organization, $project, $store_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'kVShow' + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string $store_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVShow'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function kVShowRequest($organization, $project, $store_id, string $contentType = self::contentTypes['kVShow'][0]) + { + + // verify the required parameter 'organization' is set + if ($organization === null || (is_array($organization) && count($organization) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organization when calling kVShow' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling kVShow' + ); + } + + // verify the required parameter 'store_id' is set + if ($store_id === null || (is_array($store_id) && count($store_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $store_id when calling kVShow' + ); + } + + + $resourcePath = '/api/v2/organizations/{organization}/projects/{project}/kv/{store_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organization !== null) { + $resourcePath = str_replace( + '{' . 'organization' . '}', + ObjectSerializer::toPathValue($organization), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + // path params + if ($store_id !== null) { + $resourcePath = str_replace( + '{' . 'store_id' . '}', + ObjectSerializer::toPathValue($store_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation kVUnlinkFromProject + * + * Unlink a KV store from this project + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string $store_id KV store identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVUnlinkFromProject'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\KVLinkToProject200Response|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error + */ + public function kVUnlinkFromProject($organization, $project, $store_id, string $contentType = self::contentTypes['kVUnlinkFromProject'][0]) + { + list($response) = $this->kVUnlinkFromProjectWithHttpInfo($organization, $project, $store_id, $contentType); + return $response; + } + + /** + * Operation kVUnlinkFromProjectWithHttpInfo + * + * Unlink a KV store from this project + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string $store_id KV store identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVUnlinkFromProject'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\KVLinkToProject200Response|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error, HTTP status code, HTTP response headers (array of strings) + */ + public function kVUnlinkFromProjectWithHttpInfo($organization, $project, $store_id, string $contentType = self::contentTypes['kVUnlinkFromProject'][0]) + { + $request = $this->kVUnlinkFromProjectRequest($organization, $project, $store_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\KVLinkToProject200Response', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2Error', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2Error', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\KVLinkToProject200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\KVLinkToProject200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\V2Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\V2Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation kVUnlinkFromProjectAsync + * + * Unlink a KV store from this project + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string $store_id KV store identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVUnlinkFromProject'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function kVUnlinkFromProjectAsync($organization, $project, $store_id, string $contentType = self::contentTypes['kVUnlinkFromProject'][0]) + { + return $this->kVUnlinkFromProjectAsyncWithHttpInfo($organization, $project, $store_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation kVUnlinkFromProjectAsyncWithHttpInfo + * + * Unlink a KV store from this project + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string $store_id KV store identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVUnlinkFromProject'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function kVUnlinkFromProjectAsyncWithHttpInfo($organization, $project, $store_id, string $contentType = self::contentTypes['kVUnlinkFromProject'][0]) + { + $returnType = '\QuantClient\Model\KVLinkToProject200Response'; + $request = $this->kVUnlinkFromProjectRequest($organization, $project, $store_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'kVUnlinkFromProject' + * + * @param string $organization Organization identifier (required) + * @param string $project Project identifier (required) + * @param string $store_id KV store identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['kVUnlinkFromProject'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function kVUnlinkFromProjectRequest($organization, $project, $store_id, string $contentType = self::contentTypes['kVUnlinkFromProject'][0]) + { + + // verify the required parameter 'organization' is set + if ($organization === null || (is_array($organization) && count($organization) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organization when calling kVUnlinkFromProject' + ); + } + + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project when calling kVUnlinkFromProject' + ); + } + + // verify the required parameter 'store_id' is set + if ($store_id === null || (is_array($store_id) && count($store_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $store_id when calling kVUnlinkFromProject' + ); + } + + + $resourcePath = '/api/v2/organizations/{organization}/projects/{project}/kv/{store_id}/link'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organization !== null) { + $resourcePath = str_replace( + '{' . 'organization' . '}', + ObjectSerializer::toPathValue($organization), + $resourcePath + ); + } + // path params + if ($project !== null) { + $resourcePath = str_replace( + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), + $resourcePath + ); + } + // path params + if ($store_id !== null) { + $resourcePath = str_replace( + '{' . 'store_id' . '}', + ObjectSerializer::toPathValue($store_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Create http client option * diff --git a/src/Api/OpenAICompatibilityApi.php b/src/Api/OpenAICompatibilityApi.php new file mode 100644 index 00000000..f602c58f --- /dev/null +++ b/src/Api/OpenAICompatibilityApi.php @@ -0,0 +1,1264 @@ + [ + 'application/json', + ], + 'oaiEmbeddings' => [ + 'application/json', + ], + 'oaiGetModel' => [ + 'application/json', + ], + 'oaiListModels' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation oaiChatCompletions + * + * Create a chat completion (OpenAI-compatible) + * + * @param \QuantClient\Model\OaiChatCompletionsRequest $oai_chat_completions_request oai_chat_completions_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiChatCompletions'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\OaiChatCompletions200Response + */ + public function oaiChatCompletions($oai_chat_completions_request, string $contentType = self::contentTypes['oaiChatCompletions'][0]) + { + list($response) = $this->oaiChatCompletionsWithHttpInfo($oai_chat_completions_request, $contentType); + return $response; + } + + /** + * Operation oaiChatCompletionsWithHttpInfo + * + * Create a chat completion (OpenAI-compatible) + * + * @param \QuantClient\Model\OaiChatCompletionsRequest $oai_chat_completions_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiChatCompletions'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\OaiChatCompletions200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function oaiChatCompletionsWithHttpInfo($oai_chat_completions_request, string $contentType = self::contentTypes['oaiChatCompletions'][0]) + { + $request = $this->oaiChatCompletionsRequest($oai_chat_completions_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\OaiChatCompletions200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\OaiChatCompletions200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\OaiChatCompletions200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation oaiChatCompletionsAsync + * + * Create a chat completion (OpenAI-compatible) + * + * @param \QuantClient\Model\OaiChatCompletionsRequest $oai_chat_completions_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiChatCompletions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function oaiChatCompletionsAsync($oai_chat_completions_request, string $contentType = self::contentTypes['oaiChatCompletions'][0]) + { + return $this->oaiChatCompletionsAsyncWithHttpInfo($oai_chat_completions_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation oaiChatCompletionsAsyncWithHttpInfo + * + * Create a chat completion (OpenAI-compatible) + * + * @param \QuantClient\Model\OaiChatCompletionsRequest $oai_chat_completions_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiChatCompletions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function oaiChatCompletionsAsyncWithHttpInfo($oai_chat_completions_request, string $contentType = self::contentTypes['oaiChatCompletions'][0]) + { + $returnType = '\QuantClient\Model\OaiChatCompletions200Response'; + $request = $this->oaiChatCompletionsRequest($oai_chat_completions_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'oaiChatCompletions' + * + * @param \QuantClient\Model\OaiChatCompletionsRequest $oai_chat_completions_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiChatCompletions'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function oaiChatCompletionsRequest($oai_chat_completions_request, string $contentType = self::contentTypes['oaiChatCompletions'][0]) + { + + // verify the required parameter 'oai_chat_completions_request' is set + if ($oai_chat_completions_request === null || (is_array($oai_chat_completions_request) && count($oai_chat_completions_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $oai_chat_completions_request when calling oaiChatCompletions' + ); + } + + + $resourcePath = '/oai/v1/chat/completions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($oai_chat_completions_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($oai_chat_completions_request)); + } else { + $httpBody = $oai_chat_completions_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation oaiEmbeddings + * + * Create embeddings (OpenAI-compatible) + * + * @param \QuantClient\Model\OaiEmbeddingsRequest $oai_embeddings_request oai_embeddings_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiEmbeddings'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\OaiEmbeddings200Response + */ + public function oaiEmbeddings($oai_embeddings_request, string $contentType = self::contentTypes['oaiEmbeddings'][0]) + { + list($response) = $this->oaiEmbeddingsWithHttpInfo($oai_embeddings_request, $contentType); + return $response; + } + + /** + * Operation oaiEmbeddingsWithHttpInfo + * + * Create embeddings (OpenAI-compatible) + * + * @param \QuantClient\Model\OaiEmbeddingsRequest $oai_embeddings_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiEmbeddings'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\OaiEmbeddings200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function oaiEmbeddingsWithHttpInfo($oai_embeddings_request, string $contentType = self::contentTypes['oaiEmbeddings'][0]) + { + $request = $this->oaiEmbeddingsRequest($oai_embeddings_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\OaiEmbeddings200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\OaiEmbeddings200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\OaiEmbeddings200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation oaiEmbeddingsAsync + * + * Create embeddings (OpenAI-compatible) + * + * @param \QuantClient\Model\OaiEmbeddingsRequest $oai_embeddings_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiEmbeddings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function oaiEmbeddingsAsync($oai_embeddings_request, string $contentType = self::contentTypes['oaiEmbeddings'][0]) + { + return $this->oaiEmbeddingsAsyncWithHttpInfo($oai_embeddings_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation oaiEmbeddingsAsyncWithHttpInfo + * + * Create embeddings (OpenAI-compatible) + * + * @param \QuantClient\Model\OaiEmbeddingsRequest $oai_embeddings_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiEmbeddings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function oaiEmbeddingsAsyncWithHttpInfo($oai_embeddings_request, string $contentType = self::contentTypes['oaiEmbeddings'][0]) + { + $returnType = '\QuantClient\Model\OaiEmbeddings200Response'; + $request = $this->oaiEmbeddingsRequest($oai_embeddings_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'oaiEmbeddings' + * + * @param \QuantClient\Model\OaiEmbeddingsRequest $oai_embeddings_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiEmbeddings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function oaiEmbeddingsRequest($oai_embeddings_request, string $contentType = self::contentTypes['oaiEmbeddings'][0]) + { + + // verify the required parameter 'oai_embeddings_request' is set + if ($oai_embeddings_request === null || (is_array($oai_embeddings_request) && count($oai_embeddings_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $oai_embeddings_request when calling oaiEmbeddings' + ); + } + + + $resourcePath = '/oai/v1/embeddings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($oai_embeddings_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($oai_embeddings_request)); + } else { + $httpBody = $oai_embeddings_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation oaiGetModel + * + * Retrieve a model (OpenAI-compatible) + * + * @param string $model model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiGetModel'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\OaiGetModel200Response + */ + public function oaiGetModel($model, string $contentType = self::contentTypes['oaiGetModel'][0]) + { + list($response) = $this->oaiGetModelWithHttpInfo($model, $contentType); + return $response; + } + + /** + * Operation oaiGetModelWithHttpInfo + * + * Retrieve a model (OpenAI-compatible) + * + * @param string $model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiGetModel'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\OaiGetModel200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function oaiGetModelWithHttpInfo($model, string $contentType = self::contentTypes['oaiGetModel'][0]) + { + $request = $this->oaiGetModelRequest($model, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\OaiGetModel200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\OaiGetModel200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\OaiGetModel200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation oaiGetModelAsync + * + * Retrieve a model (OpenAI-compatible) + * + * @param string $model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiGetModel'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function oaiGetModelAsync($model, string $contentType = self::contentTypes['oaiGetModel'][0]) + { + return $this->oaiGetModelAsyncWithHttpInfo($model, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation oaiGetModelAsyncWithHttpInfo + * + * Retrieve a model (OpenAI-compatible) + * + * @param string $model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiGetModel'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function oaiGetModelAsyncWithHttpInfo($model, string $contentType = self::contentTypes['oaiGetModel'][0]) + { + $returnType = '\QuantClient\Model\OaiGetModel200Response'; + $request = $this->oaiGetModelRequest($model, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'oaiGetModel' + * + * @param string $model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiGetModel'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function oaiGetModelRequest($model, string $contentType = self::contentTypes['oaiGetModel'][0]) + { + + // verify the required parameter 'model' is set + if ($model === null || (is_array($model) && count($model) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $model when calling oaiGetModel' + ); + } + + + $resourcePath = '/oai/v1/models/{model}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($model !== null) { + $resourcePath = str_replace( + '{' . 'model' . '}', + ObjectSerializer::toPathValue($model), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation oaiListModels + * + * List available models (OpenAI-compatible) + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiListModels'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\OaiListModels200Response + */ + public function oaiListModels(string $contentType = self::contentTypes['oaiListModels'][0]) + { + list($response) = $this->oaiListModelsWithHttpInfo($contentType); + return $response; + } + + /** + * Operation oaiListModelsWithHttpInfo + * + * List available models (OpenAI-compatible) + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiListModels'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\OaiListModels200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function oaiListModelsWithHttpInfo(string $contentType = self::contentTypes['oaiListModels'][0]) + { + $request = $this->oaiListModelsRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\OaiListModels200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\OaiListModels200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\OaiListModels200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation oaiListModelsAsync + * + * List available models (OpenAI-compatible) + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiListModels'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function oaiListModelsAsync(string $contentType = self::contentTypes['oaiListModels'][0]) + { + return $this->oaiListModelsAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation oaiListModelsAsyncWithHttpInfo + * + * List available models (OpenAI-compatible) + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiListModels'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function oaiListModelsAsyncWithHttpInfo(string $contentType = self::contentTypes['oaiListModels'][0]) + { + $returnType = '\QuantClient\Model\OaiListModels200Response'; + $request = $this->oaiListModelsRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'oaiListModels' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oaiListModels'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function oaiListModelsRequest(string $contentType = self::contentTypes['oaiListModels'][0]) + { + + + $resourcePath = '/oai/v1/models'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/src/Api/OrganizationsApi.php b/src/Api/OrganizationsApi.php index 9a4b4ddd..7d0b2423 100644 --- a/src/Api/OrganizationsApi.php +++ b/src/Api/OrganizationsApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/ProjectsApi.php b/src/Api/ProjectsApi.php index a15eeb3b..6861e85e 100644 --- a/src/Api/ProjectsApi.php +++ b/src/Api/ProjectsApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/PurgeApi.php b/src/Api/PurgeApi.php index 52fdfad0..e5b94723 100644 --- a/src/Api/PurgeApi.php +++ b/src/Api/PurgeApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/RestoreManagementApi.php b/src/Api/RestoreManagementApi.php new file mode 100644 index 00000000..753bcb06 --- /dev/null +++ b/src/Api/RestoreManagementApi.php @@ -0,0 +1,1257 @@ + [ + 'application/json', + ], + 'restoreDatabase' => [ + 'application/json', + ], + 'restoreFilesystem' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getRestoreStatus + * + * Get the status of a restore operation + * + * @param string $organisation The organisation ID (required) + * @param string $application The application ID (required) + * @param string $environment The environment ID (required) + * @param string $restore_id The restore operation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRestoreStatus'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\GetRestoreStatus200Response + */ + public function getRestoreStatus($organisation, $application, $environment, $restore_id, string $contentType = self::contentTypes['getRestoreStatus'][0]) + { + list($response) = $this->getRestoreStatusWithHttpInfo($organisation, $application, $environment, $restore_id, $contentType); + return $response; + } + + /** + * Operation getRestoreStatusWithHttpInfo + * + * Get the status of a restore operation + * + * @param string $organisation The organisation ID (required) + * @param string $application The application ID (required) + * @param string $environment The environment ID (required) + * @param string $restore_id The restore operation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRestoreStatus'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\GetRestoreStatus200Response, HTTP status code, HTTP response headers (array of strings) + */ + public function getRestoreStatusWithHttpInfo($organisation, $application, $environment, $restore_id, string $contentType = self::contentTypes['getRestoreStatus'][0]) + { + $request = $this->getRestoreStatusRequest($organisation, $application, $environment, $restore_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\GetRestoreStatus200Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\GetRestoreStatus200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\GetRestoreStatus200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getRestoreStatusAsync + * + * Get the status of a restore operation + * + * @param string $organisation The organisation ID (required) + * @param string $application The application ID (required) + * @param string $environment The environment ID (required) + * @param string $restore_id The restore operation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRestoreStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getRestoreStatusAsync($organisation, $application, $environment, $restore_id, string $contentType = self::contentTypes['getRestoreStatus'][0]) + { + return $this->getRestoreStatusAsyncWithHttpInfo($organisation, $application, $environment, $restore_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getRestoreStatusAsyncWithHttpInfo + * + * Get the status of a restore operation + * + * @param string $organisation The organisation ID (required) + * @param string $application The application ID (required) + * @param string $environment The environment ID (required) + * @param string $restore_id The restore operation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRestoreStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getRestoreStatusAsyncWithHttpInfo($organisation, $application, $environment, $restore_id, string $contentType = self::contentTypes['getRestoreStatus'][0]) + { + $returnType = '\QuantClient\Model\GetRestoreStatus200Response'; + $request = $this->getRestoreStatusRequest($organisation, $application, $environment, $restore_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getRestoreStatus' + * + * @param string $organisation The organisation ID (required) + * @param string $application The application ID (required) + * @param string $environment The environment ID (required) + * @param string $restore_id The restore operation ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRestoreStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getRestoreStatusRequest($organisation, $application, $environment, $restore_id, string $contentType = self::contentTypes['getRestoreStatus'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling getRestoreStatus' + ); + } + + // verify the required parameter 'application' is set + if ($application === null || (is_array($application) && count($application) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $application when calling getRestoreStatus' + ); + } + + // verify the required parameter 'environment' is set + if ($environment === null || (is_array($environment) && count($environment) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $environment when calling getRestoreStatus' + ); + } + + // verify the required parameter 'restore_id' is set + if ($restore_id === null || (is_array($restore_id) && count($restore_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $restore_id when calling getRestoreStatus' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/restores/{restoreId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($application !== null) { + $resourcePath = str_replace( + '{' . 'application' . '}', + ObjectSerializer::toPathValue($application), + $resourcePath + ); + } + // path params + if ($environment !== null) { + $resourcePath = str_replace( + '{' . 'environment' . '}', + ObjectSerializer::toPathValue($environment), + $resourcePath + ); + } + // path params + if ($restore_id !== null) { + $resourcePath = str_replace( + '{' . 'restoreId' . '}', + ObjectSerializer::toPathValue($restore_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation restoreDatabase + * + * Restore a database backup to a target environment + * + * @param string $organisation The organisation ID (required) + * @param string $application The application ID (required) + * @param string $environment The TARGET environment ID to restore INTO (required) + * @param string $backup_id The backup ID to restore from (required) + * @param \QuantClient\Model\RestoreDatabaseRequest $restore_database_request restore_database_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreDatabase'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\RestoreDatabase202Response|\QuantClient\Model\PatchEnvironmentCompose400Response + */ + public function restoreDatabase($organisation, $application, $environment, $backup_id, $restore_database_request, string $contentType = self::contentTypes['restoreDatabase'][0]) + { + list($response) = $this->restoreDatabaseWithHttpInfo($organisation, $application, $environment, $backup_id, $restore_database_request, $contentType); + return $response; + } + + /** + * Operation restoreDatabaseWithHttpInfo + * + * Restore a database backup to a target environment + * + * @param string $organisation The organisation ID (required) + * @param string $application The application ID (required) + * @param string $environment The TARGET environment ID to restore INTO (required) + * @param string $backup_id The backup ID to restore from (required) + * @param \QuantClient\Model\RestoreDatabaseRequest $restore_database_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreDatabase'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\RestoreDatabase202Response|\QuantClient\Model\PatchEnvironmentCompose400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function restoreDatabaseWithHttpInfo($organisation, $application, $environment, $backup_id, $restore_database_request, string $contentType = self::contentTypes['restoreDatabase'][0]) + { + $request = $this->restoreDatabaseRequest($organisation, $application, $environment, $backup_id, $restore_database_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 202: + return $this->handleResponseWithDataType( + '\QuantClient\Model\RestoreDatabase202Response', + $request, + $response, + ); + case 422: + return $this->handleResponseWithDataType( + '\QuantClient\Model\PatchEnvironmentCompose400Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\RestoreDatabase202Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\RestoreDatabase202Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\PatchEnvironmentCompose400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation restoreDatabaseAsync + * + * Restore a database backup to a target environment + * + * @param string $organisation The organisation ID (required) + * @param string $application The application ID (required) + * @param string $environment The TARGET environment ID to restore INTO (required) + * @param string $backup_id The backup ID to restore from (required) + * @param \QuantClient\Model\RestoreDatabaseRequest $restore_database_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreDatabase'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function restoreDatabaseAsync($organisation, $application, $environment, $backup_id, $restore_database_request, string $contentType = self::contentTypes['restoreDatabase'][0]) + { + return $this->restoreDatabaseAsyncWithHttpInfo($organisation, $application, $environment, $backup_id, $restore_database_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation restoreDatabaseAsyncWithHttpInfo + * + * Restore a database backup to a target environment + * + * @param string $organisation The organisation ID (required) + * @param string $application The application ID (required) + * @param string $environment The TARGET environment ID to restore INTO (required) + * @param string $backup_id The backup ID to restore from (required) + * @param \QuantClient\Model\RestoreDatabaseRequest $restore_database_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreDatabase'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function restoreDatabaseAsyncWithHttpInfo($organisation, $application, $environment, $backup_id, $restore_database_request, string $contentType = self::contentTypes['restoreDatabase'][0]) + { + $returnType = '\QuantClient\Model\RestoreDatabase202Response'; + $request = $this->restoreDatabaseRequest($organisation, $application, $environment, $backup_id, $restore_database_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'restoreDatabase' + * + * @param string $organisation The organisation ID (required) + * @param string $application The application ID (required) + * @param string $environment The TARGET environment ID to restore INTO (required) + * @param string $backup_id The backup ID to restore from (required) + * @param \QuantClient\Model\RestoreDatabaseRequest $restore_database_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreDatabase'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function restoreDatabaseRequest($organisation, $application, $environment, $backup_id, $restore_database_request, string $contentType = self::contentTypes['restoreDatabase'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling restoreDatabase' + ); + } + + // verify the required parameter 'application' is set + if ($application === null || (is_array($application) && count($application) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $application when calling restoreDatabase' + ); + } + + // verify the required parameter 'environment' is set + if ($environment === null || (is_array($environment) && count($environment) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $environment when calling restoreDatabase' + ); + } + + // verify the required parameter 'backup_id' is set + if ($backup_id === null || (is_array($backup_id) && count($backup_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $backup_id when calling restoreDatabase' + ); + } + + // verify the required parameter 'restore_database_request' is set + if ($restore_database_request === null || (is_array($restore_database_request) && count($restore_database_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $restore_database_request when calling restoreDatabase' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/backups/{backupId}/restore-database'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($application !== null) { + $resourcePath = str_replace( + '{' . 'application' . '}', + ObjectSerializer::toPathValue($application), + $resourcePath + ); + } + // path params + if ($environment !== null) { + $resourcePath = str_replace( + '{' . 'environment' . '}', + ObjectSerializer::toPathValue($environment), + $resourcePath + ); + } + // path params + if ($backup_id !== null) { + $resourcePath = str_replace( + '{' . 'backupId' . '}', + ObjectSerializer::toPathValue($backup_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($restore_database_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($restore_database_request)); + } else { + $httpBody = $restore_database_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation restoreFilesystem + * + * Restore a filesystem backup to a target environment + * + * @param string $organisation The organisation ID (required) + * @param string $application The application ID (required) + * @param string $environment The TARGET environment ID to restore INTO (required) + * @param string $backup_id The backup ID to restore from (required) + * @param \QuantClient\Model\RestoreFilesystemRequest $restore_filesystem_request restore_filesystem_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreFilesystem'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\RestoreFilesystem202Response|\QuantClient\Model\PatchEnvironmentCompose400Response + */ + public function restoreFilesystem($organisation, $application, $environment, $backup_id, $restore_filesystem_request, string $contentType = self::contentTypes['restoreFilesystem'][0]) + { + list($response) = $this->restoreFilesystemWithHttpInfo($organisation, $application, $environment, $backup_id, $restore_filesystem_request, $contentType); + return $response; + } + + /** + * Operation restoreFilesystemWithHttpInfo + * + * Restore a filesystem backup to a target environment + * + * @param string $organisation The organisation ID (required) + * @param string $application The application ID (required) + * @param string $environment The TARGET environment ID to restore INTO (required) + * @param string $backup_id The backup ID to restore from (required) + * @param \QuantClient\Model\RestoreFilesystemRequest $restore_filesystem_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreFilesystem'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\RestoreFilesystem202Response|\QuantClient\Model\PatchEnvironmentCompose400Response, HTTP status code, HTTP response headers (array of strings) + */ + public function restoreFilesystemWithHttpInfo($organisation, $application, $environment, $backup_id, $restore_filesystem_request, string $contentType = self::contentTypes['restoreFilesystem'][0]) + { + $request = $this->restoreFilesystemRequest($organisation, $application, $environment, $backup_id, $restore_filesystem_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 202: + return $this->handleResponseWithDataType( + '\QuantClient\Model\RestoreFilesystem202Response', + $request, + $response, + ); + case 422: + return $this->handleResponseWithDataType( + '\QuantClient\Model\PatchEnvironmentCompose400Response', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\RestoreFilesystem202Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\RestoreFilesystem202Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\PatchEnvironmentCompose400Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation restoreFilesystemAsync + * + * Restore a filesystem backup to a target environment + * + * @param string $organisation The organisation ID (required) + * @param string $application The application ID (required) + * @param string $environment The TARGET environment ID to restore INTO (required) + * @param string $backup_id The backup ID to restore from (required) + * @param \QuantClient\Model\RestoreFilesystemRequest $restore_filesystem_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreFilesystem'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function restoreFilesystemAsync($organisation, $application, $environment, $backup_id, $restore_filesystem_request, string $contentType = self::contentTypes['restoreFilesystem'][0]) + { + return $this->restoreFilesystemAsyncWithHttpInfo($organisation, $application, $environment, $backup_id, $restore_filesystem_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation restoreFilesystemAsyncWithHttpInfo + * + * Restore a filesystem backup to a target environment + * + * @param string $organisation The organisation ID (required) + * @param string $application The application ID (required) + * @param string $environment The TARGET environment ID to restore INTO (required) + * @param string $backup_id The backup ID to restore from (required) + * @param \QuantClient\Model\RestoreFilesystemRequest $restore_filesystem_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreFilesystem'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function restoreFilesystemAsyncWithHttpInfo($organisation, $application, $environment, $backup_id, $restore_filesystem_request, string $contentType = self::contentTypes['restoreFilesystem'][0]) + { + $returnType = '\QuantClient\Model\RestoreFilesystem202Response'; + $request = $this->restoreFilesystemRequest($organisation, $application, $environment, $backup_id, $restore_filesystem_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'restoreFilesystem' + * + * @param string $organisation The organisation ID (required) + * @param string $application The application ID (required) + * @param string $environment The TARGET environment ID to restore INTO (required) + * @param string $backup_id The backup ID to restore from (required) + * @param \QuantClient\Model\RestoreFilesystemRequest $restore_filesystem_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreFilesystem'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function restoreFilesystemRequest($organisation, $application, $environment, $backup_id, $restore_filesystem_request, string $contentType = self::contentTypes['restoreFilesystem'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling restoreFilesystem' + ); + } + + // verify the required parameter 'application' is set + if ($application === null || (is_array($application) && count($application) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $application when calling restoreFilesystem' + ); + } + + // verify the required parameter 'environment' is set + if ($environment === null || (is_array($environment) && count($environment) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $environment when calling restoreFilesystem' + ); + } + + // verify the required parameter 'backup_id' is set + if ($backup_id === null || (is_array($backup_id) && count($backup_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $backup_id when calling restoreFilesystem' + ); + } + + // verify the required parameter 'restore_filesystem_request' is set + if ($restore_filesystem_request === null || (is_array($restore_filesystem_request) && count($restore_filesystem_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $restore_filesystem_request when calling restoreFilesystem' + ); + } + + + $resourcePath = '/api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/backups/{backupId}/restore-filesystem'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + // path params + if ($application !== null) { + $resourcePath = str_replace( + '{' . 'application' . '}', + ObjectSerializer::toPathValue($application), + $resourcePath + ); + } + // path params + if ($environment !== null) { + $resourcePath = str_replace( + '{' . 'environment' . '}', + ObjectSerializer::toPathValue($environment), + $resourcePath + ); + } + // path params + if ($backup_id !== null) { + $resourcePath = str_replace( + '{' . 'backupId' . '}', + ObjectSerializer::toPathValue($backup_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($restore_filesystem_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($restore_filesystem_request)); + } else { + $httpBody = $restore_filesystem_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/src/Api/RulesApi.php b/src/Api/RulesApi.php index f9bcda6b..1ecf91e6 100644 --- a/src/Api/RulesApi.php +++ b/src/Api/RulesApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/SSHAccessApi.php b/src/Api/SSHAccessApi.php index 8d72b4f4..4ed185e9 100644 --- a/src/Api/SSHAccessApi.php +++ b/src/Api/SSHAccessApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/ScalingPolicyApi.php b/src/Api/ScalingPolicyApi.php index da67e4e3..b3b76c51 100644 --- a/src/Api/ScalingPolicyApi.php +++ b/src/Api/ScalingPolicyApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -77,10 +77,10 @@ class ScalingPolicyApi 'deleteScalingPolicy' => [ 'application/json', ], - 'getScalingPolicies' => [ + 'listScalingPolicies' => [ 'application/json', ], - 'updateScalingPolicy' => [ + 'upsertScalingPolicy' => [ 'application/json', ], ]; @@ -134,41 +134,43 @@ public function getConfig() /** * Operation deleteScalingPolicy * - * Delete the scaling policy for an environment + * Delete Scaling Policy * - * @param string $organisation The organisation ID (required) - * @param string $application The application ID (required) - * @param string $environment The environment ID (required) - * @param string $policy_name The policy name (required) + * @param string $organisation organisation (required) + * @param string $application application (required) + * @param string $environment environment (required) + * @param string|null $metric Optional. Delete by metric type. (optional) + * @param string|null $policy_name Optional. Delete by exact policy name. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteScalingPolicy'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ - public function deleteScalingPolicy($organisation, $application, $environment, $policy_name, string $contentType = self::contentTypes['deleteScalingPolicy'][0]) + public function deleteScalingPolicy($organisation, $application, $environment, $metric = null, $policy_name = null, string $contentType = self::contentTypes['deleteScalingPolicy'][0]) { - $this->deleteScalingPolicyWithHttpInfo($organisation, $application, $environment, $policy_name, $contentType); + $this->deleteScalingPolicyWithHttpInfo($organisation, $application, $environment, $metric, $policy_name, $contentType); } /** * Operation deleteScalingPolicyWithHttpInfo * - * Delete the scaling policy for an environment + * Delete Scaling Policy * - * @param string $organisation The organisation ID (required) - * @param string $application The application ID (required) - * @param string $environment The environment ID (required) - * @param string $policy_name The policy name (required) + * @param string $organisation (required) + * @param string $application (required) + * @param string $environment (required) + * @param string|null $metric Optional. Delete by metric type. (optional) + * @param string|null $policy_name Optional. Delete by exact policy name. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteScalingPolicy'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteScalingPolicyWithHttpInfo($organisation, $application, $environment, $policy_name, string $contentType = self::contentTypes['deleteScalingPolicy'][0]) + public function deleteScalingPolicyWithHttpInfo($organisation, $application, $environment, $metric = null, $policy_name = null, string $contentType = self::contentTypes['deleteScalingPolicy'][0]) { - $request = $this->deleteScalingPolicyRequest($organisation, $application, $environment, $policy_name, $contentType); + $request = $this->deleteScalingPolicyRequest($organisation, $application, $environment, $metric, $policy_name, $contentType); try { $options = $this->createHttpClientOption(); @@ -206,20 +208,21 @@ public function deleteScalingPolicyWithHttpInfo($organisation, $application, $en /** * Operation deleteScalingPolicyAsync * - * Delete the scaling policy for an environment + * Delete Scaling Policy * - * @param string $organisation The organisation ID (required) - * @param string $application The application ID (required) - * @param string $environment The environment ID (required) - * @param string $policy_name The policy name (required) + * @param string $organisation (required) + * @param string $application (required) + * @param string $environment (required) + * @param string|null $metric Optional. Delete by metric type. (optional) + * @param string|null $policy_name Optional. Delete by exact policy name. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteScalingPolicy'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteScalingPolicyAsync($organisation, $application, $environment, $policy_name, string $contentType = self::contentTypes['deleteScalingPolicy'][0]) + public function deleteScalingPolicyAsync($organisation, $application, $environment, $metric = null, $policy_name = null, string $contentType = self::contentTypes['deleteScalingPolicy'][0]) { - return $this->deleteScalingPolicyAsyncWithHttpInfo($organisation, $application, $environment, $policy_name, $contentType) + return $this->deleteScalingPolicyAsyncWithHttpInfo($organisation, $application, $environment, $metric, $policy_name, $contentType) ->then( function ($response) { return $response[0]; @@ -230,21 +233,22 @@ function ($response) { /** * Operation deleteScalingPolicyAsyncWithHttpInfo * - * Delete the scaling policy for an environment + * Delete Scaling Policy * - * @param string $organisation The organisation ID (required) - * @param string $application The application ID (required) - * @param string $environment The environment ID (required) - * @param string $policy_name The policy name (required) + * @param string $organisation (required) + * @param string $application (required) + * @param string $environment (required) + * @param string|null $metric Optional. Delete by metric type. (optional) + * @param string|null $policy_name Optional. Delete by exact policy name. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteScalingPolicy'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteScalingPolicyAsyncWithHttpInfo($organisation, $application, $environment, $policy_name, string $contentType = self::contentTypes['deleteScalingPolicy'][0]) + public function deleteScalingPolicyAsyncWithHttpInfo($organisation, $application, $environment, $metric = null, $policy_name = null, string $contentType = self::contentTypes['deleteScalingPolicy'][0]) { $returnType = ''; - $request = $this->deleteScalingPolicyRequest($organisation, $application, $environment, $policy_name, $contentType); + $request = $this->deleteScalingPolicyRequest($organisation, $application, $environment, $metric, $policy_name, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -272,16 +276,17 @@ function ($exception) { /** * Create request for operation 'deleteScalingPolicy' * - * @param string $organisation The organisation ID (required) - * @param string $application The application ID (required) - * @param string $environment The environment ID (required) - * @param string $policy_name The policy name (required) + * @param string $organisation (required) + * @param string $application (required) + * @param string $environment (required) + * @param string|null $metric Optional. Delete by metric type. (optional) + * @param string|null $policy_name Optional. Delete by exact policy name. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteScalingPolicy'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteScalingPolicyRequest($organisation, $application, $environment, $policy_name, string $contentType = self::contentTypes['deleteScalingPolicy'][0]) + public function deleteScalingPolicyRequest($organisation, $application, $environment, $metric = null, $policy_name = null, string $contentType = self::contentTypes['deleteScalingPolicy'][0]) { // verify the required parameter 'organisation' is set @@ -305,21 +310,34 @@ public function deleteScalingPolicyRequest($organisation, $application, $environ ); } - // verify the required parameter 'policy_name' is set - if ($policy_name === null || (is_array($policy_name) && count($policy_name) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $policy_name when calling deleteScalingPolicy' - ); - } - $resourcePath = '/api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies/{policyName}'; + + $resourcePath = '/api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $metric, + 'metric', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $policy_name, + 'policyName', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -346,14 +364,6 @@ public function deleteScalingPolicyRequest($organisation, $application, $environ $resourcePath ); } - // path params - if ($policy_name !== null) { - $resourcePath = str_replace( - '{' . 'policyName' . '}', - ObjectSerializer::toPathValue($policy_name), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -414,41 +424,46 @@ public function deleteScalingPolicyRequest($organisation, $application, $environ } /** - * Operation getScalingPolicies + * Operation listScalingPolicies * - * Get the scaling policies for an environment + * List Scaling Policies * - * @param string $organisation The organisation ID (required) - * @param string $application The application ID (required) - * @param string $environment The environment ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getScalingPolicies'] to see the possible values for this operation + * @param string $organisation organisation (required) + * @param string $application application (required) + * @param string $environment environment (required) + * @param string|null $metric Optional. Filter policies by metric type. (optional) + * @param string|null $policy_name Optional. Filter policies by exact policy name. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listScalingPolicies'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return void + * @return \QuantClient\Model\ScalingPolicyListResponse */ - public function getScalingPolicies($organisation, $application, $environment, string $contentType = self::contentTypes['getScalingPolicies'][0]) + public function listScalingPolicies($organisation, $application, $environment, $metric = null, $policy_name = null, string $contentType = self::contentTypes['listScalingPolicies'][0]) { - $this->getScalingPoliciesWithHttpInfo($organisation, $application, $environment, $contentType); + list($response) = $this->listScalingPoliciesWithHttpInfo($organisation, $application, $environment, $metric, $policy_name, $contentType); + return $response; } /** - * Operation getScalingPoliciesWithHttpInfo + * Operation listScalingPoliciesWithHttpInfo * - * Get the scaling policies for an environment + * List Scaling Policies * - * @param string $organisation The organisation ID (required) - * @param string $application The application ID (required) - * @param string $environment The environment ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getScalingPolicies'] to see the possible values for this operation + * @param string $organisation (required) + * @param string $application (required) + * @param string $environment (required) + * @param string|null $metric Optional. Filter policies by metric type. (optional) + * @param string|null $policy_name Optional. Filter policies by exact policy name. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listScalingPolicies'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \QuantClient\Model\ScalingPolicyListResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getScalingPoliciesWithHttpInfo($organisation, $application, $environment, string $contentType = self::contentTypes['getScalingPolicies'][0]) + public function listScalingPoliciesWithHttpInfo($organisation, $application, $environment, $metric = null, $policy_name = null, string $contentType = self::contentTypes['listScalingPolicies'][0]) { - $request = $this->getScalingPoliciesRequest($organisation, $application, $environment, $contentType); + $request = $this->listScalingPoliciesRequest($organisation, $application, $environment, $metric, $policy_name, $contentType); try { $options = $this->createHttpClientOption(); @@ -473,9 +488,45 @@ public function getScalingPoliciesWithHttpInfo($organisation, $application, $env $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\ScalingPolicyListResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\ScalingPolicyListResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\ScalingPolicyListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; } @@ -484,21 +535,23 @@ public function getScalingPoliciesWithHttpInfo($organisation, $application, $env } /** - * Operation getScalingPoliciesAsync + * Operation listScalingPoliciesAsync * - * Get the scaling policies for an environment + * List Scaling Policies * - * @param string $organisation The organisation ID (required) - * @param string $application The application ID (required) - * @param string $environment The environment ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getScalingPolicies'] to see the possible values for this operation + * @param string $organisation (required) + * @param string $application (required) + * @param string $environment (required) + * @param string|null $metric Optional. Filter policies by metric type. (optional) + * @param string|null $policy_name Optional. Filter policies by exact policy name. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listScalingPolicies'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getScalingPoliciesAsync($organisation, $application, $environment, string $contentType = self::contentTypes['getScalingPolicies'][0]) + public function listScalingPoliciesAsync($organisation, $application, $environment, $metric = null, $policy_name = null, string $contentType = self::contentTypes['listScalingPolicies'][0]) { - return $this->getScalingPoliciesAsyncWithHttpInfo($organisation, $application, $environment, $contentType) + return $this->listScalingPoliciesAsyncWithHttpInfo($organisation, $application, $environment, $metric, $policy_name, $contentType) ->then( function ($response) { return $response[0]; @@ -507,28 +560,43 @@ function ($response) { } /** - * Operation getScalingPoliciesAsyncWithHttpInfo + * Operation listScalingPoliciesAsyncWithHttpInfo * - * Get the scaling policies for an environment + * List Scaling Policies * - * @param string $organisation The organisation ID (required) - * @param string $application The application ID (required) - * @param string $environment The environment ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getScalingPolicies'] to see the possible values for this operation + * @param string $organisation (required) + * @param string $application (required) + * @param string $environment (required) + * @param string|null $metric Optional. Filter policies by metric type. (optional) + * @param string|null $policy_name Optional. Filter policies by exact policy name. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listScalingPolicies'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getScalingPoliciesAsyncWithHttpInfo($organisation, $application, $environment, string $contentType = self::contentTypes['getScalingPolicies'][0]) + public function listScalingPoliciesAsyncWithHttpInfo($organisation, $application, $environment, $metric = null, $policy_name = null, string $contentType = self::contentTypes['listScalingPolicies'][0]) { - $returnType = ''; - $request = $this->getScalingPoliciesRequest($organisation, $application, $environment, $contentType); + $returnType = '\QuantClient\Model\ScalingPolicyListResponse'; + $request = $this->listScalingPoliciesRequest($organisation, $application, $environment, $metric, $policy_name, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -548,41 +616,45 @@ function ($exception) { } /** - * Create request for operation 'getScalingPolicies' + * Create request for operation 'listScalingPolicies' * - * @param string $organisation The organisation ID (required) - * @param string $application The application ID (required) - * @param string $environment The environment ID (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getScalingPolicies'] to see the possible values for this operation + * @param string $organisation (required) + * @param string $application (required) + * @param string $environment (required) + * @param string|null $metric Optional. Filter policies by metric type. (optional) + * @param string|null $policy_name Optional. Filter policies by exact policy name. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listScalingPolicies'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getScalingPoliciesRequest($organisation, $application, $environment, string $contentType = self::contentTypes['getScalingPolicies'][0]) + public function listScalingPoliciesRequest($organisation, $application, $environment, $metric = null, $policy_name = null, string $contentType = self::contentTypes['listScalingPolicies'][0]) { // verify the required parameter 'organisation' is set if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $organisation when calling getScalingPolicies' + 'Missing the required parameter $organisation when calling listScalingPolicies' ); } // verify the required parameter 'application' is set if ($application === null || (is_array($application) && count($application) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $application when calling getScalingPolicies' + 'Missing the required parameter $application when calling listScalingPolicies' ); } // verify the required parameter 'environment' is set if ($environment === null || (is_array($environment) && count($environment) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $environment when calling getScalingPolicies' + 'Missing the required parameter $environment when calling listScalingPolicies' ); } + + $resourcePath = '/api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies'; $formParams = []; $queryParams = []; @@ -590,6 +662,24 @@ public function getScalingPoliciesRequest($organisation, $application, $environm $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $metric, + 'metric', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $policy_name, + 'policyName', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -619,7 +709,7 @@ public function getScalingPoliciesRequest($organisation, $application, $environm $headers = $this->headerSelector->selectHeaders( - [], + ['application/json', ], $contentType, $multipart ); @@ -676,43 +766,46 @@ public function getScalingPoliciesRequest($organisation, $application, $environm } /** - * Operation updateScalingPolicy + * Operation upsertScalingPolicy * - * Update the scaling policy for an environment + * Upsert Scaling Policy * - * @param string $organisation The organisation ID (required) - * @param string $application The application ID (required) - * @param string $environment The environment ID (required) - * @param \QuantClient\Model\ScalingPolicy $scaling_policy scaling_policy (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateScalingPolicy'] to see the possible values for this operation + * @param string $organisation organisation (required) + * @param string $application application (required) + * @param string $environment environment (required) + * @param \QuantClient\Model\SetScalingPolicyRequest $set_scaling_policy_request set_scaling_policy_request (required) + * @param string|null $policy_name Optional. Specify a custom policy name to upsert. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsertScalingPolicy'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return void + * @return \QuantClient\Model\GetScalingPolicyResponse */ - public function updateScalingPolicy($organisation, $application, $environment, $scaling_policy, string $contentType = self::contentTypes['updateScalingPolicy'][0]) + public function upsertScalingPolicy($organisation, $application, $environment, $set_scaling_policy_request, $policy_name = null, string $contentType = self::contentTypes['upsertScalingPolicy'][0]) { - $this->updateScalingPolicyWithHttpInfo($organisation, $application, $environment, $scaling_policy, $contentType); + list($response) = $this->upsertScalingPolicyWithHttpInfo($organisation, $application, $environment, $set_scaling_policy_request, $policy_name, $contentType); + return $response; } /** - * Operation updateScalingPolicyWithHttpInfo + * Operation upsertScalingPolicyWithHttpInfo * - * Update the scaling policy for an environment + * Upsert Scaling Policy * - * @param string $organisation The organisation ID (required) - * @param string $application The application ID (required) - * @param string $environment The environment ID (required) - * @param \QuantClient\Model\ScalingPolicy $scaling_policy (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateScalingPolicy'] to see the possible values for this operation + * @param string $organisation (required) + * @param string $application (required) + * @param string $environment (required) + * @param \QuantClient\Model\SetScalingPolicyRequest $set_scaling_policy_request (required) + * @param string|null $policy_name Optional. Specify a custom policy name to upsert. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsertScalingPolicy'] to see the possible values for this operation * * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \QuantClient\Model\GetScalingPolicyResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateScalingPolicyWithHttpInfo($organisation, $application, $environment, $scaling_policy, string $contentType = self::contentTypes['updateScalingPolicy'][0]) + public function upsertScalingPolicyWithHttpInfo($organisation, $application, $environment, $set_scaling_policy_request, $policy_name = null, string $contentType = self::contentTypes['upsertScalingPolicy'][0]) { - $request = $this->updateScalingPolicyRequest($organisation, $application, $environment, $scaling_policy, $contentType); + $request = $this->upsertScalingPolicyRequest($organisation, $application, $environment, $set_scaling_policy_request, $policy_name, $contentType); try { $options = $this->createHttpClientOption(); @@ -737,9 +830,45 @@ public function updateScalingPolicyWithHttpInfo($organisation, $application, $en $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\GetScalingPolicyResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\GetScalingPolicyResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\GetScalingPolicyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; } @@ -748,22 +877,23 @@ public function updateScalingPolicyWithHttpInfo($organisation, $application, $en } /** - * Operation updateScalingPolicyAsync + * Operation upsertScalingPolicyAsync * - * Update the scaling policy for an environment + * Upsert Scaling Policy * - * @param string $organisation The organisation ID (required) - * @param string $application The application ID (required) - * @param string $environment The environment ID (required) - * @param \QuantClient\Model\ScalingPolicy $scaling_policy (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateScalingPolicy'] to see the possible values for this operation + * @param string $organisation (required) + * @param string $application (required) + * @param string $environment (required) + * @param \QuantClient\Model\SetScalingPolicyRequest $set_scaling_policy_request (required) + * @param string|null $policy_name Optional. Specify a custom policy name to upsert. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsertScalingPolicy'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateScalingPolicyAsync($organisation, $application, $environment, $scaling_policy, string $contentType = self::contentTypes['updateScalingPolicy'][0]) + public function upsertScalingPolicyAsync($organisation, $application, $environment, $set_scaling_policy_request, $policy_name = null, string $contentType = self::contentTypes['upsertScalingPolicy'][0]) { - return $this->updateScalingPolicyAsyncWithHttpInfo($organisation, $application, $environment, $scaling_policy, $contentType) + return $this->upsertScalingPolicyAsyncWithHttpInfo($organisation, $application, $environment, $set_scaling_policy_request, $policy_name, $contentType) ->then( function ($response) { return $response[0]; @@ -772,29 +902,43 @@ function ($response) { } /** - * Operation updateScalingPolicyAsyncWithHttpInfo + * Operation upsertScalingPolicyAsyncWithHttpInfo * - * Update the scaling policy for an environment + * Upsert Scaling Policy * - * @param string $organisation The organisation ID (required) - * @param string $application The application ID (required) - * @param string $environment The environment ID (required) - * @param \QuantClient\Model\ScalingPolicy $scaling_policy (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateScalingPolicy'] to see the possible values for this operation + * @param string $organisation (required) + * @param string $application (required) + * @param string $environment (required) + * @param \QuantClient\Model\SetScalingPolicyRequest $set_scaling_policy_request (required) + * @param string|null $policy_name Optional. Specify a custom policy name to upsert. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsertScalingPolicy'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateScalingPolicyAsyncWithHttpInfo($organisation, $application, $environment, $scaling_policy, string $contentType = self::contentTypes['updateScalingPolicy'][0]) + public function upsertScalingPolicyAsyncWithHttpInfo($organisation, $application, $environment, $set_scaling_policy_request, $policy_name = null, string $contentType = self::contentTypes['upsertScalingPolicy'][0]) { - $returnType = ''; - $request = $this->updateScalingPolicyRequest($organisation, $application, $environment, $scaling_policy, $contentType); + $returnType = '\QuantClient\Model\GetScalingPolicyResponse'; + $request = $this->upsertScalingPolicyRequest($organisation, $application, $environment, $set_scaling_policy_request, $policy_name, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -814,49 +958,51 @@ function ($exception) { } /** - * Create request for operation 'updateScalingPolicy' + * Create request for operation 'upsertScalingPolicy' * - * @param string $organisation The organisation ID (required) - * @param string $application The application ID (required) - * @param string $environment The environment ID (required) - * @param \QuantClient\Model\ScalingPolicy $scaling_policy (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateScalingPolicy'] to see the possible values for this operation + * @param string $organisation (required) + * @param string $application (required) + * @param string $environment (required) + * @param \QuantClient\Model\SetScalingPolicyRequest $set_scaling_policy_request (required) + * @param string|null $policy_name Optional. Specify a custom policy name to upsert. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsertScalingPolicy'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateScalingPolicyRequest($organisation, $application, $environment, $scaling_policy, string $contentType = self::contentTypes['updateScalingPolicy'][0]) + public function upsertScalingPolicyRequest($organisation, $application, $environment, $set_scaling_policy_request, $policy_name = null, string $contentType = self::contentTypes['upsertScalingPolicy'][0]) { // verify the required parameter 'organisation' is set if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $organisation when calling updateScalingPolicy' + 'Missing the required parameter $organisation when calling upsertScalingPolicy' ); } // verify the required parameter 'application' is set if ($application === null || (is_array($application) && count($application) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $application when calling updateScalingPolicy' + 'Missing the required parameter $application when calling upsertScalingPolicy' ); } // verify the required parameter 'environment' is set if ($environment === null || (is_array($environment) && count($environment) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $environment when calling updateScalingPolicy' + 'Missing the required parameter $environment when calling upsertScalingPolicy' ); } - // verify the required parameter 'scaling_policy' is set - if ($scaling_policy === null || (is_array($scaling_policy) && count($scaling_policy) === 0)) { + // verify the required parameter 'set_scaling_policy_request' is set + if ($set_scaling_policy_request === null || (is_array($set_scaling_policy_request) && count($set_scaling_policy_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $scaling_policy when calling updateScalingPolicy' + 'Missing the required parameter $set_scaling_policy_request when calling upsertScalingPolicy' ); } + $resourcePath = '/api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies'; $formParams = []; $queryParams = []; @@ -864,6 +1010,15 @@ public function updateScalingPolicyRequest($organisation, $application, $environ $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $policy_name, + 'policyName', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -893,18 +1048,18 @@ public function updateScalingPolicyRequest($organisation, $application, $environ $headers = $this->headerSelector->selectHeaders( - [], + ['application/json', ], $contentType, $multipart ); // for model (json/xml) - if (isset($scaling_policy)) { + if (isset($set_scaling_policy_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($scaling_policy)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($set_scaling_policy_request)); } else { - $httpBody = $scaling_policy; + $httpBody = $set_scaling_policy_request; } } elseif (count($formParams) > 0) { if ($multipart) { diff --git a/src/Api/SubscriptionApi.php b/src/Api/SubscriptionApi.php new file mode 100644 index 00000000..6a714ae9 --- /dev/null +++ b/src/Api/SubscriptionApi.php @@ -0,0 +1,426 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getSubscriptionCloudUsage + * + * Cloud-app cost breakdown for the subscription page + * + * @param string $organisation organisation (required) + * @param string|null $month YYYY-MM, defaults to current month (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubscriptionCloudUsage'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function getSubscriptionCloudUsage($organisation, $month = null, string $contentType = self::contentTypes['getSubscriptionCloudUsage'][0]) + { + $this->getSubscriptionCloudUsageWithHttpInfo($organisation, $month, $contentType); + } + + /** + * Operation getSubscriptionCloudUsageWithHttpInfo + * + * Cloud-app cost breakdown for the subscription page + * + * @param string $organisation (required) + * @param string|null $month YYYY-MM, defaults to current month (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubscriptionCloudUsage'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function getSubscriptionCloudUsageWithHttpInfo($organisation, $month = null, string $contentType = self::contentTypes['getSubscriptionCloudUsage'][0]) + { + $request = $this->getSubscriptionCloudUsageRequest($organisation, $month, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation getSubscriptionCloudUsageAsync + * + * Cloud-app cost breakdown for the subscription page + * + * @param string $organisation (required) + * @param string|null $month YYYY-MM, defaults to current month (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubscriptionCloudUsage'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSubscriptionCloudUsageAsync($organisation, $month = null, string $contentType = self::contentTypes['getSubscriptionCloudUsage'][0]) + { + return $this->getSubscriptionCloudUsageAsyncWithHttpInfo($organisation, $month, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSubscriptionCloudUsageAsyncWithHttpInfo + * + * Cloud-app cost breakdown for the subscription page + * + * @param string $organisation (required) + * @param string|null $month YYYY-MM, defaults to current month (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubscriptionCloudUsage'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSubscriptionCloudUsageAsyncWithHttpInfo($organisation, $month = null, string $contentType = self::contentTypes['getSubscriptionCloudUsage'][0]) + { + $returnType = ''; + $request = $this->getSubscriptionCloudUsageRequest($organisation, $month, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSubscriptionCloudUsage' + * + * @param string $organisation (required) + * @param string|null $month YYYY-MM, defaults to current month (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubscriptionCloudUsage'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSubscriptionCloudUsageRequest($organisation, $month = null, string $contentType = self::contentTypes['getSubscriptionCloudUsage'][0]) + { + + // verify the required parameter 'organisation' is set + if ($organisation === null || (is_array($organisation) && count($organisation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organisation when calling getSubscriptionCloudUsage' + ); + } + + + + $resourcePath = '/api/v3/organizations/{organisation}/subscription/cloud-usage'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $month, + 'month', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organisation !== null) { + $resourcePath = str_replace( + '{' . 'organisation' . '}', + ObjectSerializer::toPathValue($organisation), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/src/Api/TokensApi.php b/src/Api/TokensApi.php new file mode 100644 index 00000000..ab2b4487 --- /dev/null +++ b/src/Api/TokensApi.php @@ -0,0 +1,1134 @@ + [ + 'application/json', + ], + 'tokensDelete' => [ + 'application/json', + ], + 'tokensList' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation tokensCreate + * + * Create a new API token scoped to this organization + * + * @param string $organization Organization identifier (required) + * @param \QuantClient\Model\TokensCreateRequest $tokens_create_request tokens_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tokensCreate'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\TokensCreate201Response|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error + */ + public function tokensCreate($organization, $tokens_create_request, string $contentType = self::contentTypes['tokensCreate'][0]) + { + list($response) = $this->tokensCreateWithHttpInfo($organization, $tokens_create_request, $contentType); + return $response; + } + + /** + * Operation tokensCreateWithHttpInfo + * + * Create a new API token scoped to this organization + * + * @param string $organization Organization identifier (required) + * @param \QuantClient\Model\TokensCreateRequest $tokens_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tokensCreate'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\TokensCreate201Response|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error, HTTP status code, HTTP response headers (array of strings) + */ + public function tokensCreateWithHttpInfo($organization, $tokens_create_request, string $contentType = self::contentTypes['tokensCreate'][0]) + { + $request = $this->tokensCreateRequest($organization, $tokens_create_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 201: + return $this->handleResponseWithDataType( + '\QuantClient\Model\TokensCreate201Response', + $request, + $response, + ); + case 400: + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2Error', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2Error', + $request, + $response, + ); + case 422: + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2Error', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\TokensCreate201Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\TokensCreate201Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\V2Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\V2Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\V2Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation tokensCreateAsync + * + * Create a new API token scoped to this organization + * + * @param string $organization Organization identifier (required) + * @param \QuantClient\Model\TokensCreateRequest $tokens_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tokensCreate'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function tokensCreateAsync($organization, $tokens_create_request, string $contentType = self::contentTypes['tokensCreate'][0]) + { + return $this->tokensCreateAsyncWithHttpInfo($organization, $tokens_create_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation tokensCreateAsyncWithHttpInfo + * + * Create a new API token scoped to this organization + * + * @param string $organization Organization identifier (required) + * @param \QuantClient\Model\TokensCreateRequest $tokens_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tokensCreate'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function tokensCreateAsyncWithHttpInfo($organization, $tokens_create_request, string $contentType = self::contentTypes['tokensCreate'][0]) + { + $returnType = '\QuantClient\Model\TokensCreate201Response'; + $request = $this->tokensCreateRequest($organization, $tokens_create_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'tokensCreate' + * + * @param string $organization Organization identifier (required) + * @param \QuantClient\Model\TokensCreateRequest $tokens_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tokensCreate'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function tokensCreateRequest($organization, $tokens_create_request, string $contentType = self::contentTypes['tokensCreate'][0]) + { + + // verify the required parameter 'organization' is set + if ($organization === null || (is_array($organization) && count($organization) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organization when calling tokensCreate' + ); + } + + // verify the required parameter 'tokens_create_request' is set + if ($tokens_create_request === null || (is_array($tokens_create_request) && count($tokens_create_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tokens_create_request when calling tokensCreate' + ); + } + + + $resourcePath = '/api/v2/organizations/{organization}/tokens'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organization !== null) { + $resourcePath = str_replace( + '{' . 'organization' . '}', + ObjectSerializer::toPathValue($organization), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($tokens_create_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($tokens_create_request)); + } else { + $httpBody = $tokens_create_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation tokensDelete + * + * Revoke an API token + * + * @param string $organization Organization identifier (required) + * @param int $token_id Token ID to revoke (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tokensDelete'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\TokensDelete200Response|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error + */ + public function tokensDelete($organization, $token_id, string $contentType = self::contentTypes['tokensDelete'][0]) + { + list($response) = $this->tokensDeleteWithHttpInfo($organization, $token_id, $contentType); + return $response; + } + + /** + * Operation tokensDeleteWithHttpInfo + * + * Revoke an API token + * + * @param string $organization Organization identifier (required) + * @param int $token_id Token ID to revoke (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tokensDelete'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\TokensDelete200Response|\QuantClient\Model\V2Error|\QuantClient\Model\V2Error, HTTP status code, HTTP response headers (array of strings) + */ + public function tokensDeleteWithHttpInfo($organization, $token_id, string $contentType = self::contentTypes['tokensDelete'][0]) + { + $request = $this->tokensDeleteRequest($organization, $token_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\TokensDelete200Response', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2Error', + $request, + $response, + ); + case 404: + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2Error', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\TokensDelete200Response', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\TokensDelete200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\V2Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\V2Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation tokensDeleteAsync + * + * Revoke an API token + * + * @param string $organization Organization identifier (required) + * @param int $token_id Token ID to revoke (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tokensDelete'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function tokensDeleteAsync($organization, $token_id, string $contentType = self::contentTypes['tokensDelete'][0]) + { + return $this->tokensDeleteAsyncWithHttpInfo($organization, $token_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation tokensDeleteAsyncWithHttpInfo + * + * Revoke an API token + * + * @param string $organization Organization identifier (required) + * @param int $token_id Token ID to revoke (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tokensDelete'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function tokensDeleteAsyncWithHttpInfo($organization, $token_id, string $contentType = self::contentTypes['tokensDelete'][0]) + { + $returnType = '\QuantClient\Model\TokensDelete200Response'; + $request = $this->tokensDeleteRequest($organization, $token_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'tokensDelete' + * + * @param string $organization Organization identifier (required) + * @param int $token_id Token ID to revoke (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tokensDelete'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function tokensDeleteRequest($organization, $token_id, string $contentType = self::contentTypes['tokensDelete'][0]) + { + + // verify the required parameter 'organization' is set + if ($organization === null || (is_array($organization) && count($organization) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organization when calling tokensDelete' + ); + } + + // verify the required parameter 'token_id' is set + if ($token_id === null || (is_array($token_id) && count($token_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $token_id when calling tokensDelete' + ); + } + + + $resourcePath = '/api/v2/organizations/{organization}/tokens/{token_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organization !== null) { + $resourcePath = str_replace( + '{' . 'organization' . '}', + ObjectSerializer::toPathValue($organization), + $resourcePath + ); + } + // path params + if ($token_id !== null) { + $resourcePath = str_replace( + '{' . 'token_id' . '}', + ObjectSerializer::toPathValue($token_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation tokensList + * + * List API tokens scoped to this organization + * + * @param string $organization Organization identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tokensList'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \QuantClient\Model\TokensList200ResponseInner[]|\QuantClient\Model\V2Error + */ + public function tokensList($organization, string $contentType = self::contentTypes['tokensList'][0]) + { + list($response) = $this->tokensListWithHttpInfo($organization, $contentType); + return $response; + } + + /** + * Operation tokensListWithHttpInfo + * + * List API tokens scoped to this organization + * + * @param string $organization Organization identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tokensList'] to see the possible values for this operation + * + * @throws \QuantClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \QuantClient\Model\TokensList200ResponseInner[]|\QuantClient\Model\V2Error, HTTP status code, HTTP response headers (array of strings) + */ + public function tokensListWithHttpInfo($organization, string $contentType = self::contentTypes['tokensList'][0]) + { + $request = $this->tokensListRequest($organization, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\QuantClient\Model\TokensList200ResponseInner[]', + $request, + $response, + ); + case 403: + return $this->handleResponseWithDataType( + '\QuantClient\Model\V2Error', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\QuantClient\Model\TokensList200ResponseInner[]', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\TokensList200ResponseInner[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\QuantClient\Model\V2Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation tokensListAsync + * + * List API tokens scoped to this organization + * + * @param string $organization Organization identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tokensList'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function tokensListAsync($organization, string $contentType = self::contentTypes['tokensList'][0]) + { + return $this->tokensListAsyncWithHttpInfo($organization, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation tokensListAsyncWithHttpInfo + * + * List API tokens scoped to this organization + * + * @param string $organization Organization identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tokensList'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function tokensListAsyncWithHttpInfo($organization, string $contentType = self::contentTypes['tokensList'][0]) + { + $returnType = '\QuantClient\Model\TokensList200ResponseInner[]'; + $request = $this->tokensListRequest($organization, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'tokensList' + * + * @param string $organization Organization identifier (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['tokensList'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function tokensListRequest($organization, string $contentType = self::contentTypes['tokensList'][0]) + { + + // verify the required parameter 'organization' is set + if ($organization === null || (is_array($organization) && count($organization) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $organization when calling tokensList' + ); + } + + + $resourcePath = '/api/v2/organizations/{organization}/tokens'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($organization !== null) { + $resourcePath = str_replace( + '{' . 'organization' . '}', + ObjectSerializer::toPathValue($organization), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/src/Api/VariablesApi.php b/src/Api/VariablesApi.php index 8d97964d..bf85a77f 100644 --- a/src/Api/VariablesApi.php +++ b/src/Api/VariablesApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Api/VolumesApi.php b/src/Api/VolumesApi.php index 10829b49..38bce4b6 100644 --- a/src/Api/VolumesApi.php +++ b/src/Api/VolumesApi.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/ApiException.php b/src/ApiException.php index 19281b84..c62843d5 100644 --- a/src/ApiException.php +++ b/src/ApiException.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Configuration.php b/src/Configuration.php index 595f7029..f461828a 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -100,7 +100,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/4.9.0/PHP'; + protected $userAgent = 'OpenAPI-Generator/4.20.0/PHP'; /** * Debug switch (default set to false) @@ -432,8 +432,8 @@ public static function toDebugReport() $report = 'PHP SDK (QuantClient) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 4.9.0' . PHP_EOL; - $report .= ' SDK Package Version: 4.9.0' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 4.20.0' . PHP_EOL; + $report .= ' SDK Package Version: 4.20.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/FormDataProcessor.php b/src/FormDataProcessor.php index 0c3babbc..eb01d1f4 100644 --- a/src/FormDataProcessor.php +++ b/src/FormDataProcessor.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/HeaderSelector.php b/src/HeaderSelector.php index 42c49c98..03588721 100644 --- a/src/HeaderSelector.php +++ b/src/HeaderSelector.php @@ -14,7 +14,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/AiSearchChatRequest.php b/src/Model/AiSearchChatRequest.php new file mode 100644 index 00000000..77ace243 --- /dev/null +++ b/src/Model/AiSearchChatRequest.php @@ -0,0 +1,523 @@ + + */ +class AiSearchChatRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AiSearch_chat_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + 'session_id' => 'string', + 'context_url' => 'string', + 'max_context_chunks' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + 'session_id' => null, + 'context_url' => 'uri', + 'max_context_chunks' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'message' => false, + 'session_id' => false, + 'context_url' => false, + 'max_context_chunks' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + 'session_id' => 'sessionId', + 'context_url' => 'contextUrl', + 'max_context_chunks' => 'maxContextChunks' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + 'session_id' => 'setSessionId', + 'context_url' => 'setContextUrl', + 'max_context_chunks' => 'setMaxContextChunks' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + 'session_id' => 'getSessionId', + 'context_url' => 'getContextUrl', + 'max_context_chunks' => 'getMaxContextChunks' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('session_id', $data ?? [], null); + $this->setIfExists('context_url', $data ?? [], null); + $this->setIfExists('max_context_chunks', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + if (!is_null($this->container['max_context_chunks']) && ($this->container['max_context_chunks'] > 20)) { + $invalidProperties[] = "invalid value for 'max_context_chunks', must be smaller than or equal to 20."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets session_id + * + * @return string|null + */ + public function getSessionId() + { + return $this->container['session_id']; + } + + /** + * Sets session_id + * + * @param string|null $session_id session_id + * + * @return self + */ + public function setSessionId($session_id) + { + if (is_null($session_id)) { + throw new \InvalidArgumentException('non-nullable session_id cannot be null'); + } + $this->container['session_id'] = $session_id; + + return $this; + } + + /** + * Gets context_url + * + * @return string|null + */ + public function getContextUrl() + { + return $this->container['context_url']; + } + + /** + * Sets context_url + * + * @param string|null $context_url context_url + * + * @return self + */ + public function setContextUrl($context_url) + { + if (is_null($context_url)) { + throw new \InvalidArgumentException('non-nullable context_url cannot be null'); + } + $this->container['context_url'] = $context_url; + + return $this; + } + + /** + * Gets max_context_chunks + * + * @return int|null + */ + public function getMaxContextChunks() + { + return $this->container['max_context_chunks']; + } + + /** + * Sets max_context_chunks + * + * @param int|null $max_context_chunks max_context_chunks + * + * @return self + */ + public function setMaxContextChunks($max_context_chunks) + { + if (is_null($max_context_chunks)) { + throw new \InvalidArgumentException('non-nullable max_context_chunks cannot be null'); + } + + if (($max_context_chunks > 20)) { + throw new \InvalidArgumentException('invalid value for $max_context_chunks when calling AiSearchChatRequest., must be smaller than or equal to 20.'); + } + + $this->container['max_context_chunks'] = $max_context_chunks; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AiSearchDeletePagesRequest.php b/src/Model/AiSearchDeletePagesRequest.php new file mode 100644 index 00000000..ebcdf9a7 --- /dev/null +++ b/src/Model/AiSearchDeletePagesRequest.php @@ -0,0 +1,443 @@ + + */ +class AiSearchDeletePagesRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AiSearch_deletePages_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'urls' => 'string[]', + 'patterns' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'urls' => 'uri', + 'patterns' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'urls' => false, + 'patterns' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'urls' => 'urls', + 'patterns' => 'patterns' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'urls' => 'setUrls', + 'patterns' => 'setPatterns' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'urls' => 'getUrls', + 'patterns' => 'getPatterns' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('urls', $data ?? [], null); + $this->setIfExists('patterns', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets urls + * + * @return string[]|null + */ + public function getUrls() + { + return $this->container['urls']; + } + + /** + * Sets urls + * + * @param string[]|null $urls urls + * + * @return self + */ + public function setUrls($urls) + { + if (is_null($urls)) { + throw new \InvalidArgumentException('non-nullable urls cannot be null'); + } + $this->container['urls'] = $urls; + + return $this; + } + + /** + * Gets patterns + * + * @return string[]|null + */ + public function getPatterns() + { + return $this->container['patterns']; + } + + /** + * Sets patterns + * + * @param string[]|null $patterns patterns + * + * @return self + */ + public function setPatterns($patterns) + { + if (is_null($patterns)) { + throw new \InvalidArgumentException('non-nullable patterns cannot be null'); + } + $this->container['patterns'] = $patterns; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AiSearchEnableRequest.php b/src/Model/AiSearchEnableRequest.php new file mode 100644 index 00000000..95179d2c --- /dev/null +++ b/src/Model/AiSearchEnableRequest.php @@ -0,0 +1,443 @@ + + */ +class AiSearchEnableRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AiSearch_enable_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'base_url' => 'string', + 'crawler_config' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'base_url' => 'uri', + 'crawler_config' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'base_url' => false, + 'crawler_config' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'base_url' => 'baseUrl', + 'crawler_config' => 'crawlerConfig' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'base_url' => 'setBaseUrl', + 'crawler_config' => 'setCrawlerConfig' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'base_url' => 'getBaseUrl', + 'crawler_config' => 'getCrawlerConfig' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('base_url', $data ?? [], null); + $this->setIfExists('crawler_config', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets base_url + * + * @return string|null + */ + public function getBaseUrl() + { + return $this->container['base_url']; + } + + /** + * Sets base_url + * + * @param string|null $base_url base_url + * + * @return self + */ + public function setBaseUrl($base_url) + { + if (is_null($base_url)) { + throw new \InvalidArgumentException('non-nullable base_url cannot be null'); + } + $this->container['base_url'] = $base_url; + + return $this; + } + + /** + * Gets crawler_config + * + * @return object|null + */ + public function getCrawlerConfig() + { + return $this->container['crawler_config']; + } + + /** + * Sets crawler_config + * + * @param object|null $crawler_config crawler_config + * + * @return self + */ + public function setCrawlerConfig($crawler_config) + { + if (is_null($crawler_config)) { + throw new \InvalidArgumentException('non-nullable crawler_config cannot be null'); + } + $this->container['crawler_config'] = $crawler_config; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AiSearchIngestPagesRequest.php b/src/Model/AiSearchIngestPagesRequest.php new file mode 100644 index 00000000..fb4f4438 --- /dev/null +++ b/src/Model/AiSearchIngestPagesRequest.php @@ -0,0 +1,446 @@ + + */ +class AiSearchIngestPagesRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AiSearch_ingestPages_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'job_id' => 'string', + 'pages' => '\QuantClient\Model\AiSearchIngestPagesRequestPagesInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'job_id' => null, + 'pages' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'job_id' => false, + 'pages' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'job_id' => 'jobId', + 'pages' => 'pages' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'job_id' => 'setJobId', + 'pages' => 'setPages' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'job_id' => 'getJobId', + 'pages' => 'getPages' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('job_id', $data ?? [], null); + $this->setIfExists('pages', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['pages'] === null) { + $invalidProperties[] = "'pages' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets job_id + * + * @return string|null + */ + public function getJobId() + { + return $this->container['job_id']; + } + + /** + * Sets job_id + * + * @param string|null $job_id job_id + * + * @return self + */ + public function setJobId($job_id) + { + if (is_null($job_id)) { + throw new \InvalidArgumentException('non-nullable job_id cannot be null'); + } + $this->container['job_id'] = $job_id; + + return $this; + } + + /** + * Gets pages + * + * @return \QuantClient\Model\AiSearchIngestPagesRequestPagesInner[] + */ + public function getPages() + { + return $this->container['pages']; + } + + /** + * Sets pages + * + * @param \QuantClient\Model\AiSearchIngestPagesRequestPagesInner[] $pages pages + * + * @return self + */ + public function setPages($pages) + { + if (is_null($pages)) { + throw new \InvalidArgumentException('non-nullable pages cannot be null'); + } + $this->container['pages'] = $pages; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AiSearchIngestPagesRequestPagesInner.php b/src/Model/AiSearchIngestPagesRequestPagesInner.php new file mode 100644 index 00000000..5d336aea --- /dev/null +++ b/src/Model/AiSearchIngestPagesRequestPagesInner.php @@ -0,0 +1,690 @@ + + */ +class AiSearchIngestPagesRequestPagesInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AiSearch_ingestPages_request_pages_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'url' => 'string', + 'title' => 'string', + 'content' => 'string', + 'content_type' => 'string', + 'fetched_at' => 'string', + 'pre_processed' => 'bool', + 'summary' => 'string', + 'tags' => 'string[]', + 'topics' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'url' => 'uri', + 'title' => null, + 'content' => null, + 'content_type' => null, + 'fetched_at' => null, + 'pre_processed' => null, + 'summary' => null, + 'tags' => null, + 'topics' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'url' => false, + 'title' => false, + 'content' => false, + 'content_type' => false, + 'fetched_at' => false, + 'pre_processed' => false, + 'summary' => false, + 'tags' => false, + 'topics' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'url' => 'url', + 'title' => 'title', + 'content' => 'content', + 'content_type' => 'contentType', + 'fetched_at' => 'fetchedAt', + 'pre_processed' => 'preProcessed', + 'summary' => 'summary', + 'tags' => 'tags', + 'topics' => 'topics' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'url' => 'setUrl', + 'title' => 'setTitle', + 'content' => 'setContent', + 'content_type' => 'setContentType', + 'fetched_at' => 'setFetchedAt', + 'pre_processed' => 'setPreProcessed', + 'summary' => 'setSummary', + 'tags' => 'setTags', + 'topics' => 'setTopics' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'url' => 'getUrl', + 'title' => 'getTitle', + 'content' => 'getContent', + 'content_type' => 'getContentType', + 'fetched_at' => 'getFetchedAt', + 'pre_processed' => 'getPreProcessed', + 'summary' => 'getSummary', + 'tags' => 'getTags', + 'topics' => 'getTopics' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('content_type', $data ?? [], null); + $this->setIfExists('fetched_at', $data ?? [], null); + $this->setIfExists('pre_processed', $data ?? [], null); + $this->setIfExists('summary', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('topics', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ($this->container['content'] === null) { + $invalidProperties[] = "'content' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url url + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title title + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content content + * + * @return self + */ + public function setContent($content) + { + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets content_type + * + * @return string|null + */ + public function getContentType() + { + return $this->container['content_type']; + } + + /** + * Sets content_type + * + * @param string|null $content_type content_type + * + * @return self + */ + public function setContentType($content_type) + { + if (is_null($content_type)) { + throw new \InvalidArgumentException('non-nullable content_type cannot be null'); + } + $this->container['content_type'] = $content_type; + + return $this; + } + + /** + * Gets fetched_at + * + * @return string|null + */ + public function getFetchedAt() + { + return $this->container['fetched_at']; + } + + /** + * Sets fetched_at + * + * @param string|null $fetched_at fetched_at + * + * @return self + */ + public function setFetchedAt($fetched_at) + { + if (is_null($fetched_at)) { + throw new \InvalidArgumentException('non-nullable fetched_at cannot be null'); + } + $this->container['fetched_at'] = $fetched_at; + + return $this; + } + + /** + * Gets pre_processed + * + * @return bool|null + */ + public function getPreProcessed() + { + return $this->container['pre_processed']; + } + + /** + * Sets pre_processed + * + * @param bool|null $pre_processed pre_processed + * + * @return self + */ + public function setPreProcessed($pre_processed) + { + if (is_null($pre_processed)) { + throw new \InvalidArgumentException('non-nullable pre_processed cannot be null'); + } + $this->container['pre_processed'] = $pre_processed; + + return $this; + } + + /** + * Gets summary + * + * @return string|null + */ + public function getSummary() + { + return $this->container['summary']; + } + + /** + * Sets summary + * + * @param string|null $summary summary + * + * @return self + */ + public function setSummary($summary) + { + if (is_null($summary)) { + throw new \InvalidArgumentException('non-nullable summary cannot be null'); + } + $this->container['summary'] = $summary; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return self + */ + public function setTags($tags) + { + if (is_null($tags)) { + throw new \InvalidArgumentException('non-nullable tags cannot be null'); + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets topics + * + * @return string[]|null + */ + public function getTopics() + { + return $this->container['topics']; + } + + /** + * Sets topics + * + * @param string[]|null $topics topics + * + * @return self + */ + public function setTopics($topics) + { + if (is_null($topics)) { + throw new \InvalidArgumentException('non-nullable topics cannot be null'); + } + $this->container['topics'] = $topics; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AiSearchSearchRequest.php b/src/Model/AiSearchSearchRequest.php new file mode 100644 index 00000000..af7cccaa --- /dev/null +++ b/src/Model/AiSearchSearchRequest.php @@ -0,0 +1,489 @@ + + */ +class AiSearchSearchRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AiSearch_search_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'query' => 'string', + 'limit' => 'int', + 'min_score' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'query' => null, + 'limit' => null, + 'min_score' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'query' => false, + 'limit' => false, + 'min_score' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'query' => 'query', + 'limit' => 'limit', + 'min_score' => 'minScore' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'limit' => 'setLimit', + 'min_score' => 'setMinScore' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'limit' => 'getLimit', + 'min_score' => 'getMinScore' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('query', $data ?? [], null); + $this->setIfExists('limit', $data ?? [], null); + $this->setIfExists('min_score', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + if (!is_null($this->container['limit']) && ($this->container['limit'] > 50)) { + $invalidProperties[] = "invalid value for 'limit', must be smaller than or equal to 50."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string $query query + * + * @return self + */ + public function setQuery($query) + { + if (is_null($query)) { + throw new \InvalidArgumentException('non-nullable query cannot be null'); + } + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets limit + * + * @return int|null + */ + public function getLimit() + { + return $this->container['limit']; + } + + /** + * Sets limit + * + * @param int|null $limit limit + * + * @return self + */ + public function setLimit($limit) + { + if (is_null($limit)) { + throw new \InvalidArgumentException('non-nullable limit cannot be null'); + } + + if (($limit > 50)) { + throw new \InvalidArgumentException('invalid value for $limit when calling AiSearchSearchRequest., must be smaller than or equal to 50.'); + } + + $this->container['limit'] = $limit; + + return $this; + } + + /** + * Gets min_score + * + * @return float|null + */ + public function getMinScore() + { + return $this->container['min_score']; + } + + /** + * Sets min_score + * + * @param float|null $min_score min_score + * + * @return self + */ + public function setMinScore($min_score) + { + if (is_null($min_score)) { + throw new \InvalidArgumentException('non-nullable min_score cannot be null'); + } + $this->container['min_score'] = $min_score; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AiSearchTriggerCrawlRequest.php b/src/Model/AiSearchTriggerCrawlRequest.php new file mode 100644 index 00000000..f248024d --- /dev/null +++ b/src/Model/AiSearchTriggerCrawlRequest.php @@ -0,0 +1,412 @@ + + */ +class AiSearchTriggerCrawlRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AiSearch_triggerCrawl_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'crawler_uuid' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'crawler_uuid' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'crawler_uuid' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'crawler_uuid' => 'crawler_uuid' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'crawler_uuid' => 'setCrawlerUuid' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'crawler_uuid' => 'getCrawlerUuid' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('crawler_uuid', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['crawler_uuid'] === null) { + $invalidProperties[] = "'crawler_uuid' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets crawler_uuid + * + * @return string + */ + public function getCrawlerUuid() + { + return $this->container['crawler_uuid']; + } + + /** + * Sets crawler_uuid + * + * @param string $crawler_uuid crawler_uuid + * + * @return self + */ + public function setCrawlerUuid($crawler_uuid) + { + if (is_null($crawler_uuid)) { + throw new \InvalidArgumentException('non-nullable crawler_uuid cannot be null'); + } + $this->container['crawler_uuid'] = $crawler_uuid; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/AiSearchUpdateSettingsRequest.php b/src/Model/AiSearchUpdateSettingsRequest.php new file mode 100644 index 00000000..e0e3c677 --- /dev/null +++ b/src/Model/AiSearchUpdateSettingsRequest.php @@ -0,0 +1,443 @@ + + */ +class AiSearchUpdateSettingsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AiSearch_updateSettings_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'public_access' => 'object', + 'rate_limits' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'public_access' => null, + 'rate_limits' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'public_access' => false, + 'rate_limits' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'public_access' => 'publicAccess', + 'rate_limits' => 'rateLimits' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'public_access' => 'setPublicAccess', + 'rate_limits' => 'setRateLimits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'public_access' => 'getPublicAccess', + 'rate_limits' => 'getRateLimits' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('public_access', $data ?? [], null); + $this->setIfExists('rate_limits', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets public_access + * + * @return object|null + */ + public function getPublicAccess() + { + return $this->container['public_access']; + } + + /** + * Sets public_access + * + * @param object|null $public_access public_access + * + * @return self + */ + public function setPublicAccess($public_access) + { + if (is_null($public_access)) { + throw new \InvalidArgumentException('non-nullable public_access cannot be null'); + } + $this->container['public_access'] = $public_access; + + return $this; + } + + /** + * Gets rate_limits + * + * @return object|null + */ + public function getRateLimits() + { + return $this->container['rate_limits']; + } + + /** + * Sets rate_limits + * + * @param object|null $rate_limits rate_limits + * + * @return self + */ + public function setRateLimits($rate_limits) + { + if (is_null($rate_limits)) { + throw new \InvalidArgumentException('non-nullable rate_limits cannot be null'); + } + $this->container['rate_limits'] = $rate_limits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/Application.php b/src/Model/Application.php index 5444a5b7..59f2a914 100644 --- a/src/Model/Application.php +++ b/src/Model/Application.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -61,6 +61,7 @@ class Application implements ModelInterface, ArrayAccess, \JsonSerializable 'organisation' => 'string', 'database' => '\QuantClient\Model\ApplicationDatabase', 'filesystem' => '\QuantClient\Model\ApplicationFilesystem', + 'cache' => '\QuantClient\Model\ApplicationCache', 'compose_definition' => '\QuantClient\Model\Compose', 'status' => 'string', 'deployment_information' => '\QuantClient\Model\ApplicationDeploymentInformationInner[]', @@ -70,7 +71,7 @@ class Application implements ModelInterface, ArrayAccess, \JsonSerializable 'max_capacity' => 'int', 'desired_count' => 'int', 'running_count' => 'int', - 'environments' => '\QuantClient\Model\ApplicationEnvironmentsInner[]' + 'environment_names' => 'string[]' ]; /** @@ -85,6 +86,7 @@ class Application implements ModelInterface, ArrayAccess, \JsonSerializable 'organisation' => null, 'database' => null, 'filesystem' => null, + 'cache' => null, 'compose_definition' => null, 'status' => null, 'deployment_information' => null, @@ -94,7 +96,7 @@ class Application implements ModelInterface, ArrayAccess, \JsonSerializable 'max_capacity' => null, 'desired_count' => null, 'running_count' => null, - 'environments' => null + 'environment_names' => null ]; /** @@ -107,6 +109,7 @@ class Application implements ModelInterface, ArrayAccess, \JsonSerializable 'organisation' => false, 'database' => true, 'filesystem' => true, + 'cache' => true, 'compose_definition' => false, 'status' => true, 'deployment_information' => true, @@ -116,7 +119,7 @@ class Application implements ModelInterface, ArrayAccess, \JsonSerializable 'max_capacity' => true, 'desired_count' => true, 'running_count' => true, - 'environments' => true + 'environment_names' => true ]; /** @@ -209,6 +212,7 @@ public function isNullableSetToNull(string $property): bool 'organisation' => 'organisation', 'database' => 'database', 'filesystem' => 'filesystem', + 'cache' => 'cache', 'compose_definition' => 'composeDefinition', 'status' => 'status', 'deployment_information' => 'deploymentInformation', @@ -218,7 +222,7 @@ public function isNullableSetToNull(string $property): bool 'max_capacity' => 'maxCapacity', 'desired_count' => 'desiredCount', 'running_count' => 'runningCount', - 'environments' => 'environments' + 'environment_names' => 'environmentNames' ]; /** @@ -231,6 +235,7 @@ public function isNullableSetToNull(string $property): bool 'organisation' => 'setOrganisation', 'database' => 'setDatabase', 'filesystem' => 'setFilesystem', + 'cache' => 'setCache', 'compose_definition' => 'setComposeDefinition', 'status' => 'setStatus', 'deployment_information' => 'setDeploymentInformation', @@ -240,7 +245,7 @@ public function isNullableSetToNull(string $property): bool 'max_capacity' => 'setMaxCapacity', 'desired_count' => 'setDesiredCount', 'running_count' => 'setRunningCount', - 'environments' => 'setEnvironments' + 'environment_names' => 'setEnvironmentNames' ]; /** @@ -253,6 +258,7 @@ public function isNullableSetToNull(string $property): bool 'organisation' => 'getOrganisation', 'database' => 'getDatabase', 'filesystem' => 'getFilesystem', + 'cache' => 'getCache', 'compose_definition' => 'getComposeDefinition', 'status' => 'getStatus', 'deployment_information' => 'getDeploymentInformation', @@ -262,7 +268,7 @@ public function isNullableSetToNull(string $property): bool 'max_capacity' => 'getMaxCapacity', 'desired_count' => 'getDesiredCount', 'running_count' => 'getRunningCount', - 'environments' => 'getEnvironments' + 'environment_names' => 'getEnvironmentNames' ]; /** @@ -326,6 +332,7 @@ public function __construct(?array $data = null) $this->setIfExists('organisation', $data ?? [], null); $this->setIfExists('database', $data ?? [], null); $this->setIfExists('filesystem', $data ?? [], null); + $this->setIfExists('cache', $data ?? [], null); $this->setIfExists('compose_definition', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); $this->setIfExists('deployment_information', $data ?? [], null); @@ -335,7 +342,7 @@ public function __construct(?array $data = null) $this->setIfExists('max_capacity', $data ?? [], null); $this->setIfExists('desired_count', $data ?? [], null); $this->setIfExists('running_count', $data ?? [], null); - $this->setIfExists('environments', $data ?? [], null); + $this->setIfExists('environment_names', $data ?? [], null); } /** @@ -508,6 +515,40 @@ public function setFilesystem($filesystem) return $this; } + /** + * Gets cache + * + * @return \QuantClient\Model\ApplicationCache|null + */ + public function getCache() + { + return $this->container['cache']; + } + + /** + * Sets cache + * + * @param \QuantClient\Model\ApplicationCache|null $cache cache + * + * @return self + */ + public function setCache($cache) + { + if (is_null($cache)) { + array_push($this->openAPINullablesSetToNull, 'cache'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cache', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cache'] = $cache; + + return $this; + } + /** * Gets compose_definition * @@ -808,35 +849,35 @@ public function setRunningCount($running_count) } /** - * Gets environments + * Gets environment_names * - * @return \QuantClient\Model\ApplicationEnvironmentsInner[]|null + * @return string[]|null */ - public function getEnvironments() + public function getEnvironmentNames() { - return $this->container['environments']; + return $this->container['environment_names']; } /** - * Sets environments + * Sets environment_names * - * @param \QuantClient\Model\ApplicationEnvironmentsInner[]|null $environments List of environments + * @param string[]|null $environment_names List of environment names (read-only) * * @return self */ - public function setEnvironments($environments) + public function setEnvironmentNames($environment_names) { - if (is_null($environments)) { - array_push($this->openAPINullablesSetToNull, 'environments'); + if (is_null($environment_names)) { + array_push($this->openAPINullablesSetToNull, 'environment_names'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('environments', $nullablesSetToNull); + $index = array_search('environment_names', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } - $this->container['environments'] = $environments; + $this->container['environment_names'] = $environment_names; return $this; } diff --git a/src/Model/ApplicationCache.php b/src/Model/ApplicationCache.php new file mode 100644 index 00000000..f1eee193 --- /dev/null +++ b/src/Model/ApplicationCache.php @@ -0,0 +1,499 @@ + + */ +class ApplicationCache implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Application_cache'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cache_endpoint' => 'string', + 'cache_identifier' => 'string', + 'data_storage_max_gb' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cache_endpoint' => null, + 'cache_identifier' => null, + 'data_storage_max_gb' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cache_endpoint' => true, + 'cache_identifier' => true, + 'data_storage_max_gb' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cache_endpoint' => 'cacheEndpoint', + 'cache_identifier' => 'cacheIdentifier', + 'data_storage_max_gb' => 'dataStorageMaxGb' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cache_endpoint' => 'setCacheEndpoint', + 'cache_identifier' => 'setCacheIdentifier', + 'data_storage_max_gb' => 'setDataStorageMaxGb' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cache_endpoint' => 'getCacheEndpoint', + 'cache_identifier' => 'getCacheIdentifier', + 'data_storage_max_gb' => 'getDataStorageMaxGb' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('cache_endpoint', $data ?? [], null); + $this->setIfExists('cache_identifier', $data ?? [], null); + $this->setIfExists('data_storage_max_gb', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets cache_endpoint + * + * @return string|null + */ + public function getCacheEndpoint() + { + return $this->container['cache_endpoint']; + } + + /** + * Sets cache_endpoint + * + * @param string|null $cache_endpoint Cache cluster endpoint + * + * @return self + */ + public function setCacheEndpoint($cache_endpoint) + { + if (is_null($cache_endpoint)) { + array_push($this->openAPINullablesSetToNull, 'cache_endpoint'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cache_endpoint', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cache_endpoint'] = $cache_endpoint; + + return $this; + } + + /** + * Gets cache_identifier + * + * @return string|null + */ + public function getCacheIdentifier() + { + return $this->container['cache_identifier']; + } + + /** + * Sets cache_identifier + * + * @param string|null $cache_identifier Cache cluster identifier + * + * @return self + */ + public function setCacheIdentifier($cache_identifier) + { + if (is_null($cache_identifier)) { + array_push($this->openAPINullablesSetToNull, 'cache_identifier'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cache_identifier', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cache_identifier'] = $cache_identifier; + + return $this; + } + + /** + * Gets data_storage_max_gb + * + * @return int|null + */ + public function getDataStorageMaxGb() + { + return $this->container['data_storage_max_gb']; + } + + /** + * Sets data_storage_max_gb + * + * @param int|null $data_storage_max_gb Maximum cache storage in GB + * + * @return self + */ + public function setDataStorageMaxGb($data_storage_max_gb) + { + if (is_null($data_storage_max_gb)) { + array_push($this->openAPINullablesSetToNull, 'data_storage_max_gb'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('data_storage_max_gb', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['data_storage_max_gb'] = $data_storage_max_gb; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ApplicationDatabase.php b/src/Model/ApplicationDatabase.php index 84ab6094..3dacb5c7 100644 --- a/src/Model/ApplicationDatabase.php +++ b/src/Model/ApplicationDatabase.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ApplicationDeploymentInformationInner.php b/src/Model/ApplicationDeploymentInformationInner.php index b4947a4a..fe271264 100644 --- a/src/Model/ApplicationDeploymentInformationInner.php +++ b/src/Model/ApplicationDeploymentInformationInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ApplicationFilesystem.php b/src/Model/ApplicationFilesystem.php index cc71ee8a..b51ab7b3 100644 --- a/src/Model/ApplicationFilesystem.php +++ b/src/Model/ApplicationFilesystem.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ApplicationImageReference.php b/src/Model/ApplicationImageReference.php index ed7a0495..a8b33c86 100644 --- a/src/Model/ApplicationImageReference.php +++ b/src/Model/ApplicationImageReference.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/BulkSetEnvironmentVariablesRequest.php b/src/Model/BulkSetEnvironmentVariablesRequest.php index b24109a4..4d93ec1d 100644 --- a/src/Model/BulkSetEnvironmentVariablesRequest.php +++ b/src/Model/BulkSetEnvironmentVariablesRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/BulkSetEnvironmentVariablesRequestEnvironmentInner.php b/src/Model/BulkSetEnvironmentVariablesRequestEnvironmentInner.php index a64186c4..eb82f4eb 100644 --- a/src/Model/BulkSetEnvironmentVariablesRequestEnvironmentInner.php +++ b/src/Model/BulkSetEnvironmentVariablesRequestEnvironmentInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInference200Response.php b/src/Model/ChatInference200Response.php index 9b022dcc..a5fa9f1a 100644 --- a/src/Model/ChatInference200Response.php +++ b/src/Model/ChatInference200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInference200ResponseResponse.php b/src/Model/ChatInference200ResponseResponse.php index e9720e6e..827d8fa8 100644 --- a/src/Model/ChatInference200ResponseResponse.php +++ b/src/Model/ChatInference200ResponseResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInference200ResponseResponseToolUse.php b/src/Model/ChatInference200ResponseResponseToolUse.php index 077137dd..ddd09ce2 100644 --- a/src/Model/ChatInference200ResponseResponseToolUse.php +++ b/src/Model/ChatInference200ResponseResponseToolUse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInference200ResponseResponseToolUseOneOf.php b/src/Model/ChatInference200ResponseResponseToolUseOneOf.php index 57b74c2d..57ae0da6 100644 --- a/src/Model/ChatInference200ResponseResponseToolUseOneOf.php +++ b/src/Model/ChatInference200ResponseResponseToolUseOneOf.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInference200ResponseResponseToolUseOneOf1Inner.php b/src/Model/ChatInference200ResponseResponseToolUseOneOf1Inner.php index 6a500b07..892b4cb8 100644 --- a/src/Model/ChatInference200ResponseResponseToolUseOneOf1Inner.php +++ b/src/Model/ChatInference200ResponseResponseToolUseOneOf1Inner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInference200ResponseResponseToolUseOneOfResult.php b/src/Model/ChatInference200ResponseResponseToolUseOneOfResult.php index b5c993e7..9a409052 100644 --- a/src/Model/ChatInference200ResponseResponseToolUseOneOfResult.php +++ b/src/Model/ChatInference200ResponseResponseToolUseOneOfResult.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInference200ResponseUsage.php b/src/Model/ChatInference200ResponseUsage.php index af4f1d8d..c0a48537 100644 --- a/src/Model/ChatInference200ResponseUsage.php +++ b/src/Model/ChatInference200ResponseUsage.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -35,7 +35,7 @@ * ChatInference200ResponseUsage Class Doc Comment * * @category Class - * @description Token usage information + * @description Token usage and cost for this inference call * @package QuantClient * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -60,7 +60,8 @@ class ChatInference200ResponseUsage implements ModelInterface, ArrayAccess, \Jso protected static $openAPITypes = [ 'input_tokens' => 'int', 'output_tokens' => 'int', - 'total_tokens' => 'int' + 'total_tokens' => 'int', + 'cost_cents' => 'float' ]; /** @@ -73,7 +74,8 @@ class ChatInference200ResponseUsage implements ModelInterface, ArrayAccess, \Jso protected static $openAPIFormats = [ 'input_tokens' => null, 'output_tokens' => null, - 'total_tokens' => null + 'total_tokens' => null, + 'cost_cents' => 'float' ]; /** @@ -84,7 +86,8 @@ class ChatInference200ResponseUsage implements ModelInterface, ArrayAccess, \Jso protected static array $openAPINullables = [ 'input_tokens' => false, 'output_tokens' => false, - 'total_tokens' => false + 'total_tokens' => false, + 'cost_cents' => false ]; /** @@ -175,7 +178,8 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'input_tokens' => 'inputTokens', 'output_tokens' => 'outputTokens', - 'total_tokens' => 'totalTokens' + 'total_tokens' => 'totalTokens', + 'cost_cents' => 'costCents' ]; /** @@ -186,7 +190,8 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'input_tokens' => 'setInputTokens', 'output_tokens' => 'setOutputTokens', - 'total_tokens' => 'setTotalTokens' + 'total_tokens' => 'setTotalTokens', + 'cost_cents' => 'setCostCents' ]; /** @@ -197,7 +202,8 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'input_tokens' => 'getInputTokens', 'output_tokens' => 'getOutputTokens', - 'total_tokens' => 'getTotalTokens' + 'total_tokens' => 'getTotalTokens', + 'cost_cents' => 'getCostCents' ]; /** @@ -260,6 +266,7 @@ public function __construct(?array $data = null) $this->setIfExists('input_tokens', $data ?? [], null); $this->setIfExists('output_tokens', $data ?? [], null); $this->setIfExists('total_tokens', $data ?? [], null); + $this->setIfExists('cost_cents', $data ?? [], null); } /** @@ -384,6 +391,33 @@ public function setTotalTokens($total_tokens) return $this; } + + /** + * Gets cost_cents + * + * @return float|null + */ + public function getCostCents() + { + return $this->container['cost_cents']; + } + + /** + * Sets cost_cents + * + * @param float|null $cost_cents Cost of this inference call in US cents + * + * @return self + */ + public function setCostCents($cost_cents) + { + if (is_null($cost_cents)) { + throw new \InvalidArgumentException('non-nullable cost_cents cannot be null'); + } + $this->container['cost_cents'] = $cost_cents; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/ChatInference202Response.php b/src/Model/ChatInference202Response.php index 5733524a..8fbda99a 100644 --- a/src/Model/ChatInference202Response.php +++ b/src/Model/ChatInference202Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequest.php b/src/Model/ChatInferenceRequest.php index dd6950c3..8ebb78fb 100644 --- a/src/Model/ChatInferenceRequest.php +++ b/src/Model/ChatInferenceRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -68,7 +68,10 @@ class ChatInferenceRequest implements ModelInterface, ArrayAccess, \JsonSerializ 'response_format' => '\QuantClient\Model\ChatInferenceRequestResponseFormat', 'tool_config' => '\QuantClient\Model\ChatInferenceRequestToolConfig', 'session_id' => 'string', - 'async' => 'bool' + 'async' => 'bool', + 'allowed_tools' => 'string[]', + 'guardrails' => '\QuantClient\Model\ChatInferenceRequestGuardrails', + 'long_context' => 'bool' ]; /** @@ -90,7 +93,10 @@ class ChatInferenceRequest implements ModelInterface, ArrayAccess, \JsonSerializ 'response_format' => null, 'tool_config' => null, 'session_id' => 'uuid', - 'async' => null + 'async' => null, + 'allowed_tools' => null, + 'guardrails' => null, + 'long_context' => null ]; /** @@ -110,7 +116,10 @@ class ChatInferenceRequest implements ModelInterface, ArrayAccess, \JsonSerializ 'response_format' => false, 'tool_config' => false, 'session_id' => false, - 'async' => false + 'async' => false, + 'allowed_tools' => false, + 'guardrails' => false, + 'long_context' => false ]; /** @@ -210,7 +219,10 @@ public function isNullableSetToNull(string $property): bool 'response_format' => 'responseFormat', 'tool_config' => 'toolConfig', 'session_id' => 'sessionId', - 'async' => 'async' + 'async' => 'async', + 'allowed_tools' => 'allowedTools', + 'guardrails' => 'guardrails', + 'long_context' => 'longContext' ]; /** @@ -230,7 +242,10 @@ public function isNullableSetToNull(string $property): bool 'response_format' => 'setResponseFormat', 'tool_config' => 'setToolConfig', 'session_id' => 'setSessionId', - 'async' => 'setAsync' + 'async' => 'setAsync', + 'allowed_tools' => 'setAllowedTools', + 'guardrails' => 'setGuardrails', + 'long_context' => 'setLongContext' ]; /** @@ -250,7 +265,10 @@ public function isNullableSetToNull(string $property): bool 'response_format' => 'getResponseFormat', 'tool_config' => 'getToolConfig', 'session_id' => 'getSessionId', - 'async' => 'getAsync' + 'async' => 'getAsync', + 'allowed_tools' => 'getAllowedTools', + 'guardrails' => 'getGuardrails', + 'long_context' => 'getLongContext' ]; /** @@ -322,6 +340,9 @@ public function __construct(?array $data = null) $this->setIfExists('tool_config', $data ?? [], null); $this->setIfExists('session_id', $data ?? [], null); $this->setIfExists('async', $data ?? [], false); + $this->setIfExists('allowed_tools', $data ?? [], null); + $this->setIfExists('guardrails', $data ?? [], null); + $this->setIfExists('long_context', $data ?? [], false); } /** @@ -760,6 +781,87 @@ public function setAsync($async) return $this; } + + /** + * Gets allowed_tools + * + * @return string[]|null + */ + public function getAllowedTools() + { + return $this->container['allowed_tools']; + } + + /** + * Sets allowed_tools + * + * @param string[]|null $allowed_tools Top-level convenience alias for toolConfig.allowedTools. Whitelists which tools can be auto-executed. + * + * @return self + */ + public function setAllowedTools($allowed_tools) + { + if (is_null($allowed_tools)) { + throw new \InvalidArgumentException('non-nullable allowed_tools cannot be null'); + } + $this->container['allowed_tools'] = $allowed_tools; + + return $this; + } + + /** + * Gets guardrails + * + * @return \QuantClient\Model\ChatInferenceRequestGuardrails|null + */ + public function getGuardrails() + { + return $this->container['guardrails']; + } + + /** + * Sets guardrails + * + * @param \QuantClient\Model\ChatInferenceRequestGuardrails|null $guardrails guardrails + * + * @return self + */ + public function setGuardrails($guardrails) + { + if (is_null($guardrails)) { + throw new \InvalidArgumentException('non-nullable guardrails cannot be null'); + } + $this->container['guardrails'] = $guardrails; + + return $this; + } + + /** + * Gets long_context + * + * @return bool|null + */ + public function getLongContext() + { + return $this->container['long_context']; + } + + /** + * Sets long_context + * + * @param bool|null $long_context Enable 1M context window support regardless of token estimation. Use when sending large payloads (>200K tokens). + * + * @return self + */ + public function setLongContext($long_context) + { + if (is_null($long_context)) { + throw new \InvalidArgumentException('non-nullable long_context cannot be null'); + } + $this->container['long_context'] = $long_context; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/ChatInferenceRequestGuardrails.php b/src/Model/ChatInferenceRequestGuardrails.php new file mode 100644 index 00000000..43687a62 --- /dev/null +++ b/src/Model/ChatInferenceRequestGuardrails.php @@ -0,0 +1,512 @@ + + */ +class ChatInferenceRequestGuardrails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'chatInference_request_guardrails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'guardrail_identifier' => 'string', + 'guardrail_version' => 'string', + 'trace' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'guardrail_identifier' => null, + 'guardrail_version' => null, + 'trace' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'guardrail_identifier' => false, + 'guardrail_version' => false, + 'trace' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'guardrail_identifier' => 'guardrailIdentifier', + 'guardrail_version' => 'guardrailVersion', + 'trace' => 'trace' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'guardrail_identifier' => 'setGuardrailIdentifier', + 'guardrail_version' => 'setGuardrailVersion', + 'trace' => 'setTrace' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'guardrail_identifier' => 'getGuardrailIdentifier', + 'guardrail_version' => 'getGuardrailVersion', + 'trace' => 'getTrace' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TRACE_ENABLED = 'enabled'; + public const TRACE_DISABLED = 'disabled'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTraceAllowableValues() + { + return [ + self::TRACE_ENABLED, + self::TRACE_DISABLED, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('guardrail_identifier', $data ?? [], null); + $this->setIfExists('guardrail_version', $data ?? [], null); + $this->setIfExists('trace', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTraceAllowableValues(); + if (!is_null($this->container['trace']) && !in_array($this->container['trace'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'trace', must be one of '%s'", + $this->container['trace'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets guardrail_identifier + * + * @return string|null + */ + public function getGuardrailIdentifier() + { + return $this->container['guardrail_identifier']; + } + + /** + * Sets guardrail_identifier + * + * @param string|null $guardrail_identifier Guardrail identifier from AWS Bedrock + * + * @return self + */ + public function setGuardrailIdentifier($guardrail_identifier) + { + if (is_null($guardrail_identifier)) { + throw new \InvalidArgumentException('non-nullable guardrail_identifier cannot be null'); + } + $this->container['guardrail_identifier'] = $guardrail_identifier; + + return $this; + } + + /** + * Gets guardrail_version + * + * @return string|null + */ + public function getGuardrailVersion() + { + return $this->container['guardrail_version']; + } + + /** + * Sets guardrail_version + * + * @param string|null $guardrail_version Guardrail version + * + * @return self + */ + public function setGuardrailVersion($guardrail_version) + { + if (is_null($guardrail_version)) { + throw new \InvalidArgumentException('non-nullable guardrail_version cannot be null'); + } + $this->container['guardrail_version'] = $guardrail_version; + + return $this; + } + + /** + * Gets trace + * + * @return string|null + */ + public function getTrace() + { + return $this->container['trace']; + } + + /** + * Sets trace + * + * @param string|null $trace Enable guardrail trace output + * + * @return self + */ + public function setTrace($trace) + { + if (is_null($trace)) { + throw new \InvalidArgumentException('non-nullable trace cannot be null'); + } + $allowedValues = $this->getTraceAllowableValues(); + if (!in_array($trace, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'trace', must be one of '%s'", + $trace, + implode("', '", $allowedValues) + ) + ); + } + $this->container['trace'] = $trace; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ChatInferenceRequestMessagesInner.php b/src/Model/ChatInferenceRequestMessagesInner.php index dffc9aae..371bf402 100644 --- a/src/Model/ChatInferenceRequestMessagesInner.php +++ b/src/Model/ChatInferenceRequestMessagesInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestMessagesInnerContent.php b/src/Model/ChatInferenceRequestMessagesInnerContent.php index 8ffa59e0..11b62201 100644 --- a/src/Model/ChatInferenceRequestMessagesInnerContent.php +++ b/src/Model/ChatInferenceRequestMessagesInnerContent.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInner.php b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInner.php index b92a3b25..ded86c7d 100644 --- a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInner.php +++ b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf.php b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf.php index 0c358681..e1dcf072 100644 --- a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf.php +++ b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf1.php b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf1.php index 77dba469..27015c4b 100644 --- a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf1.php +++ b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf1.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf1Image.php b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf1Image.php index 2c247e4e..4d1c2787 100644 --- a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf1Image.php +++ b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf1Image.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf1ImageSource.php b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf1ImageSource.php index 3a52b690..1e4f08be 100644 --- a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf1ImageSource.php +++ b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf1ImageSource.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf2.php b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf2.php index 74c0721a..ee15454f 100644 --- a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf2.php +++ b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf2.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf2Video.php b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf2Video.php index 0aff0ecb..b4e65bbf 100644 --- a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf2Video.php +++ b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf2Video.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf2VideoSource.php b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf2VideoSource.php index a65a9070..d95b6b76 100644 --- a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf2VideoSource.php +++ b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf2VideoSource.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf3.php b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf3.php index 9933a92b..078ff899 100644 --- a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf3.php +++ b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf3.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf3Document.php b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf3Document.php index 0c2a69a8..a8995173 100644 --- a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf3Document.php +++ b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf3Document.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf3DocumentSource.php b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf3DocumentSource.php index 1b4ff954..7d917a28 100644 --- a/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf3DocumentSource.php +++ b/src/Model/ChatInferenceRequestMessagesInnerContentOneOfInnerOneOf3DocumentSource.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestResponseFormat.php b/src/Model/ChatInferenceRequestResponseFormat.php index 0f19b23f..db434632 100644 --- a/src/Model/ChatInferenceRequestResponseFormat.php +++ b/src/Model/ChatInferenceRequestResponseFormat.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestToolConfig.php b/src/Model/ChatInferenceRequestToolConfig.php index 886f305c..a9ba5bd5 100644 --- a/src/Model/ChatInferenceRequestToolConfig.php +++ b/src/Model/ChatInferenceRequestToolConfig.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestToolConfigToolsInner.php b/src/Model/ChatInferenceRequestToolConfigToolsInner.php index 378c2512..6ea17f6c 100644 --- a/src/Model/ChatInferenceRequestToolConfigToolsInner.php +++ b/src/Model/ChatInferenceRequestToolConfigToolsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestToolConfigToolsInnerToolSpec.php b/src/Model/ChatInferenceRequestToolConfigToolsInnerToolSpec.php index 97a14a01..e4829d33 100644 --- a/src/Model/ChatInferenceRequestToolConfigToolsInnerToolSpec.php +++ b/src/Model/ChatInferenceRequestToolConfigToolsInnerToolSpec.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceRequestToolConfigToolsInnerToolSpecInputSchema.php b/src/Model/ChatInferenceRequestToolConfigToolsInnerToolSpecInputSchema.php index c7a42550..0286df50 100644 --- a/src/Model/ChatInferenceRequestToolConfigToolsInnerToolSpecInputSchema.php +++ b/src/Model/ChatInferenceRequestToolConfigToolsInnerToolSpecInputSchema.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceStreamRequest.php b/src/Model/ChatInferenceStreamRequest.php index b5fc9dad..54be8926 100644 --- a/src/Model/ChatInferenceStreamRequest.php +++ b/src/Model/ChatInferenceStreamRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -67,7 +67,10 @@ class ChatInferenceStreamRequest implements ModelInterface, ArrayAccess, \JsonSe 'response_format' => '\QuantClient\Model\ChatInferenceRequestResponseFormat', 'tool_config' => '\QuantClient\Model\ChatInferenceRequestToolConfig', 'session_id' => 'string', - 'async' => 'bool' + 'async' => 'bool', + 'allowed_tools' => 'string[]', + 'guardrails' => '\QuantClient\Model\ChatInferenceRequestGuardrails', + 'long_context' => 'bool' ]; /** @@ -88,7 +91,10 @@ class ChatInferenceStreamRequest implements ModelInterface, ArrayAccess, \JsonSe 'response_format' => null, 'tool_config' => null, 'session_id' => 'uuid', - 'async' => null + 'async' => null, + 'allowed_tools' => null, + 'guardrails' => null, + 'long_context' => null ]; /** @@ -107,7 +113,10 @@ class ChatInferenceStreamRequest implements ModelInterface, ArrayAccess, \JsonSe 'response_format' => false, 'tool_config' => false, 'session_id' => false, - 'async' => false + 'async' => false, + 'allowed_tools' => false, + 'guardrails' => false, + 'long_context' => false ]; /** @@ -206,7 +215,10 @@ public function isNullableSetToNull(string $property): bool 'response_format' => 'responseFormat', 'tool_config' => 'toolConfig', 'session_id' => 'sessionId', - 'async' => 'async' + 'async' => 'async', + 'allowed_tools' => 'allowedTools', + 'guardrails' => 'guardrails', + 'long_context' => 'longContext' ]; /** @@ -225,7 +237,10 @@ public function isNullableSetToNull(string $property): bool 'response_format' => 'setResponseFormat', 'tool_config' => 'setToolConfig', 'session_id' => 'setSessionId', - 'async' => 'setAsync' + 'async' => 'setAsync', + 'allowed_tools' => 'setAllowedTools', + 'guardrails' => 'setGuardrails', + 'long_context' => 'setLongContext' ]; /** @@ -244,7 +259,10 @@ public function isNullableSetToNull(string $property): bool 'response_format' => 'getResponseFormat', 'tool_config' => 'getToolConfig', 'session_id' => 'getSessionId', - 'async' => 'getAsync' + 'async' => 'getAsync', + 'allowed_tools' => 'getAllowedTools', + 'guardrails' => 'getGuardrails', + 'long_context' => 'getLongContext' ]; /** @@ -315,6 +333,9 @@ public function __construct(?array $data = null) $this->setIfExists('tool_config', $data ?? [], null); $this->setIfExists('session_id', $data ?? [], null); $this->setIfExists('async', $data ?? [], false); + $this->setIfExists('allowed_tools', $data ?? [], null); + $this->setIfExists('guardrails', $data ?? [], null); + $this->setIfExists('long_context', $data ?? [], false); } /** @@ -726,6 +747,87 @@ public function setAsync($async) return $this; } + + /** + * Gets allowed_tools + * + * @return string[]|null + */ + public function getAllowedTools() + { + return $this->container['allowed_tools']; + } + + /** + * Sets allowed_tools + * + * @param string[]|null $allowed_tools Top-level convenience alias for toolConfig.allowedTools. Whitelists which tools can be auto-executed. + * + * @return self + */ + public function setAllowedTools($allowed_tools) + { + if (is_null($allowed_tools)) { + throw new \InvalidArgumentException('non-nullable allowed_tools cannot be null'); + } + $this->container['allowed_tools'] = $allowed_tools; + + return $this; + } + + /** + * Gets guardrails + * + * @return \QuantClient\Model\ChatInferenceRequestGuardrails|null + */ + public function getGuardrails() + { + return $this->container['guardrails']; + } + + /** + * Sets guardrails + * + * @param \QuantClient\Model\ChatInferenceRequestGuardrails|null $guardrails guardrails + * + * @return self + */ + public function setGuardrails($guardrails) + { + if (is_null($guardrails)) { + throw new \InvalidArgumentException('non-nullable guardrails cannot be null'); + } + $this->container['guardrails'] = $guardrails; + + return $this; + } + + /** + * Gets long_context + * + * @return bool|null + */ + public function getLongContext() + { + return $this->container['long_context']; + } + + /** + * Sets long_context + * + * @param bool|null $long_context Enable 1M context window support regardless of token estimation. Use when sending large payloads (>200K tokens). + * + * @return self + */ + public function setLongContext($long_context) + { + if (is_null($long_context)) { + throw new \InvalidArgumentException('non-nullable long_context cannot be null'); + } + $this->container['long_context'] = $long_context; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/ChatInferenceStreamRequestMessagesInner.php b/src/Model/ChatInferenceStreamRequestMessagesInner.php index 4408994f..56392b32 100644 --- a/src/Model/ChatInferenceStreamRequestMessagesInner.php +++ b/src/Model/ChatInferenceStreamRequestMessagesInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatInferenceStreamRequestMessagesInnerContent.php b/src/Model/ChatInferenceStreamRequestMessagesInnerContent.php index 1625ec38..3e6c42d7 100644 --- a/src/Model/ChatInferenceStreamRequestMessagesInnerContent.php +++ b/src/Model/ChatInferenceStreamRequestMessagesInnerContent.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatWithAIAgent200Response.php b/src/Model/ChatWithAIAgent200Response.php index 6cfa862f..bfcd241a 100644 --- a/src/Model/ChatWithAIAgent200Response.php +++ b/src/Model/ChatWithAIAgent200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatWithAIAgent200ResponseResponse.php b/src/Model/ChatWithAIAgent200ResponseResponse.php index 98073998..64df709a 100644 --- a/src/Model/ChatWithAIAgent200ResponseResponse.php +++ b/src/Model/ChatWithAIAgent200ResponseResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatWithAIAgent200ResponseResponseUsage.php b/src/Model/ChatWithAIAgent200ResponseResponseUsage.php index 67996609..ca1aff4e 100644 --- a/src/Model/ChatWithAIAgent200ResponseResponseUsage.php +++ b/src/Model/ChatWithAIAgent200ResponseResponseUsage.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -58,7 +58,9 @@ class ChatWithAIAgent200ResponseResponseUsage implements ModelInterface, ArrayAc */ protected static $openAPITypes = [ 'input_tokens' => 'int', - 'output_tokens' => 'int' + 'output_tokens' => 'int', + 'total_tokens' => 'int', + 'cost_cents' => 'float' ]; /** @@ -70,7 +72,9 @@ class ChatWithAIAgent200ResponseResponseUsage implements ModelInterface, ArrayAc */ protected static $openAPIFormats = [ 'input_tokens' => null, - 'output_tokens' => null + 'output_tokens' => null, + 'total_tokens' => null, + 'cost_cents' => 'float' ]; /** @@ -80,7 +84,9 @@ class ChatWithAIAgent200ResponseResponseUsage implements ModelInterface, ArrayAc */ protected static array $openAPINullables = [ 'input_tokens' => false, - 'output_tokens' => false + 'output_tokens' => false, + 'total_tokens' => false, + 'cost_cents' => false ]; /** @@ -170,7 +176,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'input_tokens' => 'inputTokens', - 'output_tokens' => 'outputTokens' + 'output_tokens' => 'outputTokens', + 'total_tokens' => 'totalTokens', + 'cost_cents' => 'costCents' ]; /** @@ -180,7 +188,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'input_tokens' => 'setInputTokens', - 'output_tokens' => 'setOutputTokens' + 'output_tokens' => 'setOutputTokens', + 'total_tokens' => 'setTotalTokens', + 'cost_cents' => 'setCostCents' ]; /** @@ -190,7 +200,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'input_tokens' => 'getInputTokens', - 'output_tokens' => 'getOutputTokens' + 'output_tokens' => 'getOutputTokens', + 'total_tokens' => 'getTotalTokens', + 'cost_cents' => 'getCostCents' ]; /** @@ -252,6 +264,8 @@ public function __construct(?array $data = null) { $this->setIfExists('input_tokens', $data ?? [], null); $this->setIfExists('output_tokens', $data ?? [], null); + $this->setIfExists('total_tokens', $data ?? [], null); + $this->setIfExists('cost_cents', $data ?? [], null); } /** @@ -349,6 +363,60 @@ public function setOutputTokens($output_tokens) return $this; } + + /** + * Gets total_tokens + * + * @return int|null + */ + public function getTotalTokens() + { + return $this->container['total_tokens']; + } + + /** + * Sets total_tokens + * + * @param int|null $total_tokens total_tokens + * + * @return self + */ + public function setTotalTokens($total_tokens) + { + if (is_null($total_tokens)) { + throw new \InvalidArgumentException('non-nullable total_tokens cannot be null'); + } + $this->container['total_tokens'] = $total_tokens; + + return $this; + } + + /** + * Gets cost_cents + * + * @return float|null + */ + public function getCostCents() + { + return $this->container['cost_cents']; + } + + /** + * Sets cost_cents + * + * @param float|null $cost_cents Cost of this inference call in US cents + * + * @return self + */ + public function setCostCents($cost_cents) + { + if (is_null($cost_cents)) { + throw new \InvalidArgumentException('non-nullable cost_cents cannot be null'); + } + $this->container['cost_cents'] = $cost_cents; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/ChatWithAIAgent202Response.php b/src/Model/ChatWithAIAgent202Response.php index 738283a5..691b06fe 100644 --- a/src/Model/ChatWithAIAgent202Response.php +++ b/src/Model/ChatWithAIAgent202Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ChatWithAIAgentRequest.php b/src/Model/ChatWithAIAgentRequest.php index cdba7495..6a07dfe0 100644 --- a/src/Model/ChatWithAIAgentRequest.php +++ b/src/Model/ChatWithAIAgentRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -62,7 +62,10 @@ class ChatWithAIAgentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'user_id' => 'string', 'stream' => 'bool', 'async' => 'bool', - 'system' => 'string' + 'system' => 'string', + 'long_context' => 'bool', + 'max_tool_iterations' => 'int', + 'allowed_collections' => 'string[]' ]; /** @@ -78,7 +81,10 @@ class ChatWithAIAgentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'user_id' => null, 'stream' => null, 'async' => null, - 'system' => null + 'system' => null, + 'long_context' => null, + 'max_tool_iterations' => null, + 'allowed_collections' => null ]; /** @@ -92,7 +98,10 @@ class ChatWithAIAgentRequest implements ModelInterface, ArrayAccess, \JsonSerial 'user_id' => false, 'stream' => false, 'async' => false, - 'system' => false + 'system' => false, + 'long_context' => false, + 'max_tool_iterations' => false, + 'allowed_collections' => false ]; /** @@ -186,7 +195,10 @@ public function isNullableSetToNull(string $property): bool 'user_id' => 'userId', 'stream' => 'stream', 'async' => 'async', - 'system' => 'system' + 'system' => 'system', + 'long_context' => 'longContext', + 'max_tool_iterations' => 'maxToolIterations', + 'allowed_collections' => 'allowedCollections' ]; /** @@ -200,7 +212,10 @@ public function isNullableSetToNull(string $property): bool 'user_id' => 'setUserId', 'stream' => 'setStream', 'async' => 'setAsync', - 'system' => 'setSystem' + 'system' => 'setSystem', + 'long_context' => 'setLongContext', + 'max_tool_iterations' => 'setMaxToolIterations', + 'allowed_collections' => 'setAllowedCollections' ]; /** @@ -214,7 +229,10 @@ public function isNullableSetToNull(string $property): bool 'user_id' => 'getUserId', 'stream' => 'getStream', 'async' => 'getAsync', - 'system' => 'getSystem' + 'system' => 'getSystem', + 'long_context' => 'getLongContext', + 'max_tool_iterations' => 'getMaxToolIterations', + 'allowed_collections' => 'getAllowedCollections' ]; /** @@ -280,6 +298,9 @@ public function __construct(?array $data = null) $this->setIfExists('stream', $data ?? [], false); $this->setIfExists('async', $data ?? [], false); $this->setIfExists('system', $data ?? [], null); + $this->setIfExists('long_context', $data ?? [], false); + $this->setIfExists('max_tool_iterations', $data ?? [], null); + $this->setIfExists('allowed_collections', $data ?? [], null); } /** @@ -312,6 +333,14 @@ public function listInvalidProperties() if ($this->container['message'] === null) { $invalidProperties[] = "'message' can't be null"; } + if (!is_null($this->container['max_tool_iterations']) && ($this->container['max_tool_iterations'] > 1000)) { + $invalidProperties[] = "invalid value for 'max_tool_iterations', must be smaller than or equal to 1000."; + } + + if (!is_null($this->container['max_tool_iterations']) && ($this->container['max_tool_iterations'] < 1)) { + $invalidProperties[] = "invalid value for 'max_tool_iterations', must be bigger than or equal to 1."; + } + return $invalidProperties; } @@ -488,6 +517,95 @@ public function setSystem($system) return $this; } + + /** + * Gets long_context + * + * @return bool|null + */ + public function getLongContext() + { + return $this->container['long_context']; + } + + /** + * Sets long_context + * + * @param bool|null $long_context Per-request override to force 1M context window routing + * + * @return self + */ + public function setLongContext($long_context) + { + if (is_null($long_context)) { + throw new \InvalidArgumentException('non-nullable long_context cannot be null'); + } + $this->container['long_context'] = $long_context; + + return $this; + } + + /** + * Gets max_tool_iterations + * + * @return int|null + */ + public function getMaxToolIterations() + { + return $this->container['max_tool_iterations']; + } + + /** + * Sets max_tool_iterations + * + * @param int|null $max_tool_iterations Maximum tool auto-execution iterations for this request + * + * @return self + */ + public function setMaxToolIterations($max_tool_iterations) + { + if (is_null($max_tool_iterations)) { + throw new \InvalidArgumentException('non-nullable max_tool_iterations cannot be null'); + } + + if (($max_tool_iterations > 1000)) { + throw new \InvalidArgumentException('invalid value for $max_tool_iterations when calling ChatWithAIAgentRequest., must be smaller than or equal to 1000.'); + } + if (($max_tool_iterations < 1)) { + throw new \InvalidArgumentException('invalid value for $max_tool_iterations when calling ChatWithAIAgentRequest., must be bigger than or equal to 1.'); + } + + $this->container['max_tool_iterations'] = $max_tool_iterations; + + return $this; + } + + /** + * Gets allowed_collections + * + * @return string[]|null + */ + public function getAllowedCollections() + { + return $this->container['allowed_collections']; + } + + /** + * Sets allowed_collections + * + * @param string[]|null $allowed_collections Per-request override for vector DB collections the agent can query + * + * @return self + */ + public function setAllowedCollections($allowed_collections) + { + if (is_null($allowed_collections)) { + throw new \InvalidArgumentException('non-nullable allowed_collections cannot be null'); + } + $this->container['allowed_collections'] = $allowed_collections; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/Command.php b/src/Model/Command.php index ad4b9e33..b1fe75d8 100644 --- a/src/Model/Command.php +++ b/src/Model/Command.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/Compose.php b/src/Model/Compose.php index 78d73102..a25b6ab0 100644 --- a/src/Model/Compose.php +++ b/src/Model/Compose.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -63,6 +63,8 @@ class Compose implements ModelInterface, ArrayAccess, \JsonSerializable 'task_memory' => 'int', 'min_capacity' => 'int', 'max_capacity' => 'int', + 'single_task_only' => 'bool', + 'startup_grace_period_seconds' => 'int', 'spot_configuration' => '\QuantClient\Model\SpotConfiguration', 'enable_cross_env_networking' => 'bool', 'enable_cross_app_networking' => 'bool' @@ -82,6 +84,8 @@ class Compose implements ModelInterface, ArrayAccess, \JsonSerializable 'task_memory' => null, 'min_capacity' => null, 'max_capacity' => null, + 'single_task_only' => null, + 'startup_grace_period_seconds' => null, 'spot_configuration' => null, 'enable_cross_env_networking' => null, 'enable_cross_app_networking' => null @@ -99,6 +103,8 @@ class Compose implements ModelInterface, ArrayAccess, \JsonSerializable 'task_memory' => false, 'min_capacity' => false, 'max_capacity' => false, + 'single_task_only' => true, + 'startup_grace_period_seconds' => true, 'spot_configuration' => false, 'enable_cross_env_networking' => true, 'enable_cross_app_networking' => true @@ -196,6 +202,8 @@ public function isNullableSetToNull(string $property): bool 'task_memory' => 'taskMemory', 'min_capacity' => 'minCapacity', 'max_capacity' => 'maxCapacity', + 'single_task_only' => 'singleTaskOnly', + 'startup_grace_period_seconds' => 'startupGracePeriodSeconds', 'spot_configuration' => 'spotConfiguration', 'enable_cross_env_networking' => 'enableCrossEnvNetworking', 'enable_cross_app_networking' => 'enableCrossAppNetworking' @@ -213,6 +221,8 @@ public function isNullableSetToNull(string $property): bool 'task_memory' => 'setTaskMemory', 'min_capacity' => 'setMinCapacity', 'max_capacity' => 'setMaxCapacity', + 'single_task_only' => 'setSingleTaskOnly', + 'startup_grace_period_seconds' => 'setStartupGracePeriodSeconds', 'spot_configuration' => 'setSpotConfiguration', 'enable_cross_env_networking' => 'setEnableCrossEnvNetworking', 'enable_cross_app_networking' => 'setEnableCrossAppNetworking' @@ -230,6 +240,8 @@ public function isNullableSetToNull(string $property): bool 'task_memory' => 'getTaskMemory', 'min_capacity' => 'getMinCapacity', 'max_capacity' => 'getMaxCapacity', + 'single_task_only' => 'getSingleTaskOnly', + 'startup_grace_period_seconds' => 'getStartupGracePeriodSeconds', 'spot_configuration' => 'getSpotConfiguration', 'enable_cross_env_networking' => 'getEnableCrossEnvNetworking', 'enable_cross_app_networking' => 'getEnableCrossAppNetworking' @@ -298,6 +310,8 @@ public function __construct(?array $data = null) $this->setIfExists('task_memory', $data ?? [], null); $this->setIfExists('min_capacity', $data ?? [], null); $this->setIfExists('max_capacity', $data ?? [], null); + $this->setIfExists('single_task_only', $data ?? [], null); + $this->setIfExists('startup_grace_period_seconds', $data ?? [], 120); $this->setIfExists('spot_configuration', $data ?? [], null); $this->setIfExists('enable_cross_env_networking', $data ?? [], false); $this->setIfExists('enable_cross_app_networking', $data ?? [], false); @@ -330,6 +344,14 @@ public function listInvalidProperties() { $invalidProperties = []; + if (!is_null($this->container['startup_grace_period_seconds']) && ($this->container['startup_grace_period_seconds'] > 3600)) { + $invalidProperties[] = "invalid value for 'startup_grace_period_seconds', must be smaller than or equal to 3600."; + } + + if (!is_null($this->container['startup_grace_period_seconds']) && ($this->container['startup_grace_period_seconds'] < 0)) { + $invalidProperties[] = "invalid value for 'startup_grace_period_seconds', must be bigger than or equal to 0."; + } + return $invalidProperties; } @@ -507,6 +529,82 @@ public function setMaxCapacity($max_capacity) return $this; } + /** + * Gets single_task_only + * + * @return bool|null + */ + public function getSingleTaskOnly() + { + return $this->container['single_task_only']; + } + + /** + * Sets single_task_only + * + * @param bool|null $single_task_only Optional. Forces single-task mode for data-safe applications (max one running task). When true: capacity is locked to 1. When false: explicitly allows scaling. When omitted: the platform auto-detects stateful containers and enables single-task mode if found. + * + * @return self + */ + public function setSingleTaskOnly($single_task_only) + { + if (is_null($single_task_only)) { + array_push($this->openAPINullablesSetToNull, 'single_task_only'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('single_task_only', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['single_task_only'] = $single_task_only; + + return $this; + } + + /** + * Gets startup_grace_period_seconds + * + * @return int|null + */ + public function getStartupGracePeriodSeconds() + { + return $this->container['startup_grace_period_seconds']; + } + + /** + * Sets startup_grace_period_seconds + * + * @param int|null $startup_grace_period_seconds Optional. Seconds the load balancer waits after a task starts before an unhealthy health check can replace it (applied as the ECS service's healthCheckGracePeriodSeconds when a load balancer is attached). Raise for apps that are slow to boot, e.g. run migrations on startup. Tasks that become healthy sooner still enter service immediately. Defaults to 120 when omitted. + * + * @return self + */ + public function setStartupGracePeriodSeconds($startup_grace_period_seconds) + { + if (is_null($startup_grace_period_seconds)) { + array_push($this->openAPINullablesSetToNull, 'startup_grace_period_seconds'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startup_grace_period_seconds', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($startup_grace_period_seconds) && ($startup_grace_period_seconds > 3600)) { + throw new \InvalidArgumentException('invalid value for $startup_grace_period_seconds when calling Compose., must be smaller than or equal to 3600.'); + } + if (!is_null($startup_grace_period_seconds) && ($startup_grace_period_seconds < 0)) { + throw new \InvalidArgumentException('invalid value for $startup_grace_period_seconds when calling Compose., must be bigger than or equal to 0.'); + } + + $this->container['startup_grace_period_seconds'] = $startup_grace_period_seconds; + + return $this; + } + /** * Gets spot_configuration * diff --git a/src/Model/Container.php b/src/Model/Container.php index 485d783e..e3f72d01 100644 --- a/src/Model/Container.php +++ b/src/Model/Container.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ContainerDependsOnInner.php b/src/Model/ContainerDependsOnInner.php index 83074a03..4a08cd7f 100644 --- a/src/Model/ContainerDependsOnInner.php +++ b/src/Model/ContainerDependsOnInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ContainerEnvironmentInner.php b/src/Model/ContainerEnvironmentInner.php index 63611240..580280f2 100644 --- a/src/Model/ContainerEnvironmentInner.php +++ b/src/Model/ContainerEnvironmentInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ContainerHealthCheck.php b/src/Model/ContainerHealthCheck.php index 33571763..ded1871f 100644 --- a/src/Model/ContainerHealthCheck.php +++ b/src/Model/ContainerHealthCheck.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ContainerImageReference.php b/src/Model/ContainerImageReference.php index 30d2cb93..04f833e0 100644 --- a/src/Model/ContainerImageReference.php +++ b/src/Model/ContainerImageReference.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ContainerMountPointsInner.php b/src/Model/ContainerMountPointsInner.php index 86b14838..360f636d 100644 --- a/src/Model/ContainerMountPointsInner.php +++ b/src/Model/ContainerMountPointsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ContainerOriginProtectionConfig.php b/src/Model/ContainerOriginProtectionConfig.php index 86b2a318..892f6afc 100644 --- a/src/Model/ContainerOriginProtectionConfig.php +++ b/src/Model/ContainerOriginProtectionConfig.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -59,7 +59,8 @@ class ContainerOriginProtectionConfig implements ModelInterface, ArrayAccess, \J */ protected static $openAPITypes = [ 'enabled' => 'bool', - 'ip_allow' => 'string[]' + 'ip_allow' => 'string[]', + 'redirect_host' => 'string' ]; /** @@ -71,7 +72,8 @@ class ContainerOriginProtectionConfig implements ModelInterface, ArrayAccess, \J */ protected static $openAPIFormats = [ 'enabled' => null, - 'ip_allow' => null + 'ip_allow' => null, + 'redirect_host' => null ]; /** @@ -81,7 +83,8 @@ class ContainerOriginProtectionConfig implements ModelInterface, ArrayAccess, \J */ protected static array $openAPINullables = [ 'enabled' => false, - 'ip_allow' => true + 'ip_allow' => true, + 'redirect_host' => true ]; /** @@ -171,7 +174,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'enabled' => 'enabled', - 'ip_allow' => 'ipAllow' + 'ip_allow' => 'ipAllow', + 'redirect_host' => 'redirectHost' ]; /** @@ -181,7 +185,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'enabled' => 'setEnabled', - 'ip_allow' => 'setIpAllow' + 'ip_allow' => 'setIpAllow', + 'redirect_host' => 'setRedirectHost' ]; /** @@ -191,7 +196,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'enabled' => 'getEnabled', - 'ip_allow' => 'getIpAllow' + 'ip_allow' => 'getIpAllow', + 'redirect_host' => 'getRedirectHost' ]; /** @@ -253,6 +259,7 @@ public function __construct(?array $data = null) { $this->setIfExists('enabled', $data ?? [], true); $this->setIfExists('ip_allow', $data ?? [], null); + $this->setIfExists('redirect_host', $data ?? [], null); } /** @@ -357,6 +364,40 @@ public function setIpAllow($ip_allow) return $this; } + + /** + * Gets redirect_host + * + * @return string|null + */ + public function getRedirectHost() + { + return $this->container['redirect_host']; + } + + /** + * Sets redirect_host + * + * @param string|null $redirect_host Optional bare host (e.g. www.example.com). When set, requests denied by origin protection are 302-redirected to https:// with path and query preserved, instead of receiving a 403. Allowed IPs and valid-header (CDN) traffic are unaffected. + * + * @return self + */ + public function setRedirectHost($redirect_host) + { + if (is_null($redirect_host)) { + array_push($this->openAPINullablesSetToNull, 'redirect_host'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('redirect_host', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['redirect_host'] = $redirect_host; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/ContainerSecretsInner.php b/src/Model/ContainerSecretsInner.php index 11cada7d..7bdd77cb 100644 --- a/src/Model/ContainerSecretsInner.php +++ b/src/Model/ContainerSecretsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CrawlersRun200Response.php b/src/Model/CrawlersRun200Response.php index af54c747..241dbf9b 100644 --- a/src/Model/CrawlersRun200Response.php +++ b/src/Model/CrawlersRun200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CrawlersRunRequest.php b/src/Model/CrawlersRunRequest.php index 248de50b..b28c86b7 100644 --- a/src/Model/CrawlersRunRequest.php +++ b/src/Model/CrawlersRunRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateAIAgent201Response.php b/src/Model/CreateAIAgent201Response.php index 30368c93..93d1984a 100644 --- a/src/Model/CreateAIAgent201Response.php +++ b/src/Model/CreateAIAgent201Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateAIAgentRequest.php b/src/Model/CreateAIAgentRequest.php index 5727c895..c60c70cf 100644 --- a/src/Model/CreateAIAgentRequest.php +++ b/src/Model/CreateAIAgentRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -66,7 +66,11 @@ class CreateAIAgentRequest implements ModelInterface, ArrayAccess, \JsonSerializ 'max_tokens' => 'int', 'allowed_tools' => 'string[]', 'allowed_collections' => 'string[]', - 'created_by' => 'string' + 'assigned_skills' => 'string[]', + 'created_by' => 'string', + 'long_context' => 'bool', + 'guardrail_preset' => 'string', + 'filter_policies' => 'string[]' ]; /** @@ -86,7 +90,11 @@ class CreateAIAgentRequest implements ModelInterface, ArrayAccess, \JsonSerializ 'max_tokens' => null, 'allowed_tools' => null, 'allowed_collections' => null, - 'created_by' => null + 'assigned_skills' => null, + 'created_by' => null, + 'long_context' => null, + 'guardrail_preset' => null, + 'filter_policies' => null ]; /** @@ -104,7 +112,11 @@ class CreateAIAgentRequest implements ModelInterface, ArrayAccess, \JsonSerializ 'max_tokens' => false, 'allowed_tools' => false, 'allowed_collections' => false, - 'created_by' => false + 'assigned_skills' => false, + 'created_by' => false, + 'long_context' => false, + 'guardrail_preset' => true, + 'filter_policies' => false ]; /** @@ -202,7 +214,11 @@ public function isNullableSetToNull(string $property): bool 'max_tokens' => 'maxTokens', 'allowed_tools' => 'allowedTools', 'allowed_collections' => 'allowedCollections', - 'created_by' => 'createdBy' + 'assigned_skills' => 'assignedSkills', + 'created_by' => 'createdBy', + 'long_context' => 'longContext', + 'guardrail_preset' => 'guardrailPreset', + 'filter_policies' => 'filterPolicies' ]; /** @@ -220,7 +236,11 @@ public function isNullableSetToNull(string $property): bool 'max_tokens' => 'setMaxTokens', 'allowed_tools' => 'setAllowedTools', 'allowed_collections' => 'setAllowedCollections', - 'created_by' => 'setCreatedBy' + 'assigned_skills' => 'setAssignedSkills', + 'created_by' => 'setCreatedBy', + 'long_context' => 'setLongContext', + 'guardrail_preset' => 'setGuardrailPreset', + 'filter_policies' => 'setFilterPolicies' ]; /** @@ -238,7 +258,11 @@ public function isNullableSetToNull(string $property): bool 'max_tokens' => 'getMaxTokens', 'allowed_tools' => 'getAllowedTools', 'allowed_collections' => 'getAllowedCollections', - 'created_by' => 'getCreatedBy' + 'assigned_skills' => 'getAssignedSkills', + 'created_by' => 'getCreatedBy', + 'long_context' => 'getLongContext', + 'guardrail_preset' => 'getGuardrailPreset', + 'filter_policies' => 'getFilterPolicies' ]; /** @@ -282,6 +306,23 @@ public function getModelName() return self::$openAPIModelName; } + public const GUARDRAIL_PRESET_OFFICIAL = 'official'; + public const GUARDRAIL_PRESET_OFFICIAL_SENSITIVE = 'official-sensitive'; + public const GUARDRAIL_PRESET__PROTECTED = 'protected'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getGuardrailPresetAllowableValues() + { + return [ + self::GUARDRAIL_PRESET_OFFICIAL, + self::GUARDRAIL_PRESET_OFFICIAL_SENSITIVE, + self::GUARDRAIL_PRESET__PROTECTED, + ]; + } /** * Associative array for storing property values @@ -307,7 +348,11 @@ public function __construct(?array $data = null) $this->setIfExists('max_tokens', $data ?? [], null); $this->setIfExists('allowed_tools', $data ?? [], null); $this->setIfExists('allowed_collections', $data ?? [], null); + $this->setIfExists('assigned_skills', $data ?? [], null); $this->setIfExists('created_by', $data ?? [], null); + $this->setIfExists('long_context', $data ?? [], null); + $this->setIfExists('guardrail_preset', $data ?? [], null); + $this->setIfExists('filter_policies', $data ?? [], null); } /** @@ -365,6 +410,15 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'max_tokens', must be bigger than or equal to 1."; } + $allowedValues = $this->getGuardrailPresetAllowableValues(); + if (!is_null($this->container['guardrail_preset']) && !in_array($this->container['guardrail_preset'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'guardrail_preset', must be one of '%s'", + $this->container['guardrail_preset'], + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -639,6 +693,33 @@ public function setAllowedCollections($allowed_collections) return $this; } + /** + * Gets assigned_skills + * + * @return string[]|null + */ + public function getAssignedSkills() + { + return $this->container['assigned_skills']; + } + + /** + * Sets assigned_skills + * + * @param string[]|null $assigned_skills Skill IDs to assign to this agent + * + * @return self + */ + public function setAssignedSkills($assigned_skills) + { + if (is_null($assigned_skills)) { + throw new \InvalidArgumentException('non-nullable assigned_skills cannot be null'); + } + $this->container['assigned_skills'] = $assigned_skills; + + return $this; + } + /** * Gets created_by * @@ -665,6 +746,104 @@ public function setCreatedBy($created_by) return $this; } + + /** + * Gets long_context + * + * @return bool|null + */ + public function getLongContext() + { + return $this->container['long_context']; + } + + /** + * Sets long_context + * + * @param bool|null $long_context Enable 1M context window support + * + * @return self + */ + public function setLongContext($long_context) + { + if (is_null($long_context)) { + throw new \InvalidArgumentException('non-nullable long_context cannot be null'); + } + $this->container['long_context'] = $long_context; + + return $this; + } + + /** + * Gets guardrail_preset + * + * @return string|null + */ + public function getGuardrailPreset() + { + return $this->container['guardrail_preset']; + } + + /** + * Sets guardrail_preset + * + * @param string|null $guardrail_preset Guardrail preset name + * + * @return self + */ + public function setGuardrailPreset($guardrail_preset) + { + if (is_null($guardrail_preset)) { + array_push($this->openAPINullablesSetToNull, 'guardrail_preset'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('guardrail_preset', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $allowedValues = $this->getGuardrailPresetAllowableValues(); + if (!is_null($guardrail_preset) && !in_array($guardrail_preset, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'guardrail_preset', must be one of '%s'", + $guardrail_preset, + implode("', '", $allowedValues) + ) + ); + } + $this->container['guardrail_preset'] = $guardrail_preset; + + return $this; + } + + /** + * Gets filter_policies + * + * @return string[]|null + */ + public function getFilterPolicies() + { + return $this->container['filter_policies']; + } + + /** + * Sets filter_policies + * + * @param string[]|null $filter_policies Filter policy IDs to apply to this agent's inference requests + * + * @return self + */ + public function setFilterPolicies($filter_policies) + { + if (is_null($filter_policies)) { + throw new \InvalidArgumentException('non-nullable filter_policies cannot be null'); + } + $this->container['filter_policies'] = $filter_policies; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/CreateAISession201Response.php b/src/Model/CreateAISession201Response.php index 163d6f59..e4cdcef8 100644 --- a/src/Model/CreateAISession201Response.php +++ b/src/Model/CreateAISession201Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateAISessionRequest.php b/src/Model/CreateAISessionRequest.php index a8565208..f6c5b461 100644 --- a/src/Model/CreateAISessionRequest.php +++ b/src/Model/CreateAISessionRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateAISessionRequestInitialMessagesInner.php b/src/Model/CreateAISessionRequestInitialMessagesInner.php index 370a65bf..6fc7e26f 100644 --- a/src/Model/CreateAISessionRequestInitialMessagesInner.php +++ b/src/Model/CreateAISessionRequestInitialMessagesInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateApplication403Response.php b/src/Model/CreateApplication403Response.php index 49f14e0e..b627cd36 100644 --- a/src/Model/CreateApplication403Response.php +++ b/src/Model/CreateApplication403Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateApplicationRequest.php b/src/Model/CreateApplicationRequest.php index c139bcc0..3aae40cd 100644 --- a/src/Model/CreateApplicationRequest.php +++ b/src/Model/CreateApplicationRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateApplicationRequestDatabase.php b/src/Model/CreateApplicationRequestDatabase.php index b1337ac2..6196ca12 100644 --- a/src/Model/CreateApplicationRequestDatabase.php +++ b/src/Model/CreateApplicationRequestDatabase.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateApplicationRequestEnvironmentInner.php b/src/Model/CreateApplicationRequestEnvironmentInner.php index 70c65d3a..6b100d9d 100644 --- a/src/Model/CreateApplicationRequestEnvironmentInner.php +++ b/src/Model/CreateApplicationRequestEnvironmentInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateApplicationRequestFilesystem.php b/src/Model/CreateApplicationRequestFilesystem.php index 8e506aff..3193c9bb 100644 --- a/src/Model/CreateApplicationRequestFilesystem.php +++ b/src/Model/CreateApplicationRequestFilesystem.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateBackup202Response.php b/src/Model/CreateBackup202Response.php index c997c048..faaef5f2 100644 --- a/src/Model/CreateBackup202Response.php +++ b/src/Model/CreateBackup202Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateBackupRequest.php b/src/Model/CreateBackupRequest.php index 73f55dd1..22b461f4 100644 --- a/src/Model/CreateBackupRequest.php +++ b/src/Model/CreateBackupRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateCommandRequest.php b/src/Model/CreateCommandRequest.php index dfdbd9aa..c40f8af6 100644 --- a/src/Model/CreateCommandRequest.php +++ b/src/Model/CreateCommandRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateCronJobRequest.php b/src/Model/CreateCronJobRequest.php index b67071cb..60ae4a3a 100644 --- a/src/Model/CreateCronJobRequest.php +++ b/src/Model/CreateCronJobRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateCustomTool201Response.php b/src/Model/CreateCustomTool201Response.php index e626aac8..80bc69a5 100644 --- a/src/Model/CreateCustomTool201Response.php +++ b/src/Model/CreateCustomTool201Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -59,6 +59,9 @@ class CreateCustomTool201Response implements ModelInterface, ArrayAccess, \JsonS protected static $openAPITypes = [ 'success' => 'bool', 'tool' => 'object', + 'edge_function_url' => 'string', + 'edge_function_code' => 'string', + 'is_update' => 'bool', 'message' => 'string' ]; @@ -72,6 +75,9 @@ class CreateCustomTool201Response implements ModelInterface, ArrayAccess, \JsonS protected static $openAPIFormats = [ 'success' => null, 'tool' => null, + 'edge_function_url' => null, + 'edge_function_code' => null, + 'is_update' => null, 'message' => null ]; @@ -83,6 +89,9 @@ class CreateCustomTool201Response implements ModelInterface, ArrayAccess, \JsonS protected static array $openAPINullables = [ 'success' => false, 'tool' => false, + 'edge_function_url' => false, + 'edge_function_code' => false, + 'is_update' => false, 'message' => false ]; @@ -174,6 +183,9 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'success' => 'success', 'tool' => 'tool', + 'edge_function_url' => 'edgeFunctionUrl', + 'edge_function_code' => 'edgeFunctionCode', + 'is_update' => 'isUpdate', 'message' => 'message' ]; @@ -185,6 +197,9 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'success' => 'setSuccess', 'tool' => 'setTool', + 'edge_function_url' => 'setEdgeFunctionUrl', + 'edge_function_code' => 'setEdgeFunctionCode', + 'is_update' => 'setIsUpdate', 'message' => 'setMessage' ]; @@ -196,6 +211,9 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'success' => 'getSuccess', 'tool' => 'getTool', + 'edge_function_url' => 'getEdgeFunctionUrl', + 'edge_function_code' => 'getEdgeFunctionCode', + 'is_update' => 'getIsUpdate', 'message' => 'getMessage' ]; @@ -258,6 +276,9 @@ public function __construct(?array $data = null) { $this->setIfExists('success', $data ?? [], null); $this->setIfExists('tool', $data ?? [], null); + $this->setIfExists('edge_function_url', $data ?? [], null); + $this->setIfExists('edge_function_code', $data ?? [], null); + $this->setIfExists('is_update', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); } @@ -357,6 +378,87 @@ public function setTool($tool) return $this; } + /** + * Gets edge_function_url + * + * @return string|null + */ + public function getEdgeFunctionUrl() + { + return $this->container['edge_function_url']; + } + + /** + * Sets edge_function_url + * + * @param string|null $edge_function_url Computed edge function URL (read-only) + * + * @return self + */ + public function setEdgeFunctionUrl($edge_function_url) + { + if (is_null($edge_function_url)) { + throw new \InvalidArgumentException('non-nullable edge_function_url cannot be null'); + } + $this->container['edge_function_url'] = $edge_function_url; + + return $this; + } + + /** + * Gets edge_function_code + * + * @return string|null + */ + public function getEdgeFunctionCode() + { + return $this->container['edge_function_code']; + } + + /** + * Sets edge_function_code + * + * @param string|null $edge_function_code The deployed edge function code + * + * @return self + */ + public function setEdgeFunctionCode($edge_function_code) + { + if (is_null($edge_function_code)) { + throw new \InvalidArgumentException('non-nullable edge_function_code cannot be null'); + } + $this->container['edge_function_code'] = $edge_function_code; + + return $this; + } + + /** + * Gets is_update + * + * @return bool|null + */ + public function getIsUpdate() + { + return $this->container['is_update']; + } + + /** + * Sets is_update + * + * @param bool|null $is_update Whether this was an update to an existing tool + * + * @return self + */ + public function setIsUpdate($is_update) + { + if (is_null($is_update)) { + throw new \InvalidArgumentException('non-nullable is_update cannot be null'); + } + $this->container['is_update'] = $is_update; + + return $this; + } + /** * Gets message * diff --git a/src/Model/CreateCustomToolRequest.php b/src/Model/CreateCustomToolRequest.php index dc331d4a..8ce86023 100644 --- a/src/Model/CreateCustomToolRequest.php +++ b/src/Model/CreateCustomToolRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -59,10 +59,14 @@ class CreateCustomToolRequest implements ModelInterface, ArrayAccess, \JsonSeria protected static $openAPITypes = [ 'name' => 'string', 'description' => 'string', - 'edge_function_url' => 'string', - 'input_schema' => 'object', + 'edge_function_code' => 'string', + 'input_schema' => 'string', 'is_async' => 'bool', - 'timeout_seconds' => 'int' + 'timeout_seconds' => 'int', + 'output_schema' => 'string', + 'output_schema_description' => 'string', + 'category' => 'string', + 'response_mode' => 'string' ]; /** @@ -75,10 +79,14 @@ class CreateCustomToolRequest implements ModelInterface, ArrayAccess, \JsonSeria protected static $openAPIFormats = [ 'name' => null, 'description' => null, - 'edge_function_url' => null, + 'edge_function_code' => null, 'input_schema' => null, 'is_async' => null, - 'timeout_seconds' => null + 'timeout_seconds' => null, + 'output_schema' => null, + 'output_schema_description' => null, + 'category' => null, + 'response_mode' => null ]; /** @@ -89,10 +97,14 @@ class CreateCustomToolRequest implements ModelInterface, ArrayAccess, \JsonSeria protected static array $openAPINullables = [ 'name' => false, 'description' => false, - 'edge_function_url' => false, + 'edge_function_code' => false, 'input_schema' => false, 'is_async' => false, - 'timeout_seconds' => false + 'timeout_seconds' => false, + 'output_schema' => true, + 'output_schema_description' => true, + 'category' => true, + 'response_mode' => true ]; /** @@ -183,10 +195,14 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'name' => 'name', 'description' => 'description', - 'edge_function_url' => 'edgeFunctionUrl', + 'edge_function_code' => 'edgeFunctionCode', 'input_schema' => 'inputSchema', 'is_async' => 'isAsync', - 'timeout_seconds' => 'timeoutSeconds' + 'timeout_seconds' => 'timeoutSeconds', + 'output_schema' => 'outputSchema', + 'output_schema_description' => 'outputSchemaDescription', + 'category' => 'category', + 'response_mode' => 'responseMode' ]; /** @@ -197,10 +213,14 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'name' => 'setName', 'description' => 'setDescription', - 'edge_function_url' => 'setEdgeFunctionUrl', + 'edge_function_code' => 'setEdgeFunctionCode', 'input_schema' => 'setInputSchema', 'is_async' => 'setIsAsync', - 'timeout_seconds' => 'setTimeoutSeconds' + 'timeout_seconds' => 'setTimeoutSeconds', + 'output_schema' => 'setOutputSchema', + 'output_schema_description' => 'setOutputSchemaDescription', + 'category' => 'setCategory', + 'response_mode' => 'setResponseMode' ]; /** @@ -211,10 +231,14 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'name' => 'getName', 'description' => 'getDescription', - 'edge_function_url' => 'getEdgeFunctionUrl', + 'edge_function_code' => 'getEdgeFunctionCode', 'input_schema' => 'getInputSchema', 'is_async' => 'getIsAsync', - 'timeout_seconds' => 'getTimeoutSeconds' + 'timeout_seconds' => 'getTimeoutSeconds', + 'output_schema' => 'getOutputSchema', + 'output_schema_description' => 'getOutputSchemaDescription', + 'category' => 'getCategory', + 'response_mode' => 'getResponseMode' ]; /** @@ -258,6 +282,21 @@ public function getModelName() return self::$openAPIModelName; } + public const RESPONSE_MODE_LLM = 'llm'; + public const RESPONSE_MODE_DIRECT = 'direct'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResponseModeAllowableValues() + { + return [ + self::RESPONSE_MODE_LLM, + self::RESPONSE_MODE_DIRECT, + ]; + } /** * Associative array for storing property values @@ -276,10 +315,14 @@ public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('edge_function_url', $data ?? [], null); + $this->setIfExists('edge_function_code', $data ?? [], null); $this->setIfExists('input_schema', $data ?? [], null); $this->setIfExists('is_async', $data ?? [], false); $this->setIfExists('timeout_seconds', $data ?? [], 30); + $this->setIfExists('output_schema', $data ?? [], null); + $this->setIfExists('output_schema_description', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('response_mode', $data ?? [], null); } /** @@ -315,8 +358,8 @@ public function listInvalidProperties() if ($this->container['description'] === null) { $invalidProperties[] = "'description' can't be null"; } - if ($this->container['edge_function_url'] === null) { - $invalidProperties[] = "'edge_function_url' can't be null"; + if ($this->container['edge_function_code'] === null) { + $invalidProperties[] = "'edge_function_code' can't be null"; } if ($this->container['input_schema'] === null) { $invalidProperties[] = "'input_schema' can't be null"; @@ -329,6 +372,19 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'timeout_seconds', must be bigger than or equal to 5."; } + if (!is_null($this->container['category']) && (mb_strlen($this->container['category']) > 100)) { + $invalidProperties[] = "invalid value for 'category', the character length must be smaller than or equal to 100."; + } + + $allowedValues = $this->getResponseModeAllowableValues(); + if (!is_null($this->container['response_mode']) && !in_array($this->container['response_mode'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'response_mode', must be one of '%s'", + $this->container['response_mode'], + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -399,28 +455,28 @@ public function setDescription($description) } /** - * Gets edge_function_url + * Gets edge_function_code * * @return string */ - public function getEdgeFunctionUrl() + public function getEdgeFunctionCode() { - return $this->container['edge_function_url']; + return $this->container['edge_function_code']; } /** - * Sets edge_function_url + * Sets edge_function_code * - * @param string $edge_function_url HTTPS URL of the edge function + * @param string $edge_function_code JavaScript source code for the edge function * * @return self */ - public function setEdgeFunctionUrl($edge_function_url) + public function setEdgeFunctionCode($edge_function_code) { - if (is_null($edge_function_url)) { - throw new \InvalidArgumentException('non-nullable edge_function_url cannot be null'); + if (is_null($edge_function_code)) { + throw new \InvalidArgumentException('non-nullable edge_function_code cannot be null'); } - $this->container['edge_function_url'] = $edge_function_url; + $this->container['edge_function_code'] = $edge_function_code; return $this; } @@ -428,7 +484,7 @@ public function setEdgeFunctionUrl($edge_function_url) /** * Gets input_schema * - * @return object + * @return string */ public function getInputSchema() { @@ -438,7 +494,7 @@ public function getInputSchema() /** * Sets input_schema * - * @param object $input_schema JSON Schema defining the tool's input parameters + * @param string $input_schema JSON-encoded JSON Schema object defining the tool's input parameters * * @return self */ @@ -513,6 +569,156 @@ public function setTimeoutSeconds($timeout_seconds) return $this; } + + /** + * Gets output_schema + * + * @return string|null + */ + public function getOutputSchema() + { + return $this->container['output_schema']; + } + + /** + * Sets output_schema + * + * @param string|null $output_schema JSON-encoded JSON Schema object defining the tool's output structure + * + * @return self + */ + public function setOutputSchema($output_schema) + { + if (is_null($output_schema)) { + array_push($this->openAPINullablesSetToNull, 'output_schema'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('output_schema', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['output_schema'] = $output_schema; + + return $this; + } + + /** + * Gets output_schema_description + * + * @return string|null + */ + public function getOutputSchemaDescription() + { + return $this->container['output_schema_description']; + } + + /** + * Sets output_schema_description + * + * @param string|null $output_schema_description Human-readable description of the tool's output + * + * @return self + */ + public function setOutputSchemaDescription($output_schema_description) + { + if (is_null($output_schema_description)) { + array_push($this->openAPINullablesSetToNull, 'output_schema_description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('output_schema_description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['output_schema_description'] = $output_schema_description; + + return $this; + } + + /** + * Gets category + * + * @return string|null + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string|null $category Category to group related tools + * + * @return self + */ + public function setCategory($category) + { + if (is_null($category)) { + array_push($this->openAPINullablesSetToNull, 'category'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('category', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($category) && (mb_strlen($category) > 100)) { + throw new \InvalidArgumentException('invalid length for $category when calling CreateCustomToolRequest., must be smaller than or equal to 100.'); + } + + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets response_mode + * + * @return string|null + */ + public function getResponseMode() + { + return $this->container['response_mode']; + } + + /** + * Sets response_mode + * + * @param string|null $response_mode How the tool response is handled: llm (passed back to model) or direct (returned to user) + * + * @return self + */ + public function setResponseMode($response_mode) + { + if (is_null($response_mode)) { + array_push($this->openAPINullablesSetToNull, 'response_mode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('response_mode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $allowedValues = $this->getResponseModeAllowableValues(); + if (!is_null($response_mode) && !in_array($response_mode, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'response_mode', must be one of '%s'", + $response_mode, + implode("', '", $allowedValues) + ) + ); + } + $this->container['response_mode'] = $response_mode; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/CreateEnvironment403Response.php b/src/Model/CreateEnvironment403Response.php index 7f624daf..b56185bc 100644 --- a/src/Model/CreateEnvironment403Response.php +++ b/src/Model/CreateEnvironment403Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateEnvironmentRequest.php b/src/Model/CreateEnvironmentRequest.php index 3d814c73..8549c672 100644 --- a/src/Model/CreateEnvironmentRequest.php +++ b/src/Model/CreateEnvironmentRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -60,6 +60,8 @@ class CreateEnvironmentRequest implements ModelInterface, ArrayAccess, \JsonSeri 'env_name' => 'string', 'min_capacity' => 'int', 'max_capacity' => 'int', + 'single_task_only' => 'bool', + 'startup_grace_period_seconds' => 'int', 'clone_configuration_from' => 'string', 'compose_definition' => '\QuantClient\Model\Compose', 'image_suffix' => 'string', @@ -79,6 +81,8 @@ class CreateEnvironmentRequest implements ModelInterface, ArrayAccess, \JsonSeri 'env_name' => null, 'min_capacity' => null, 'max_capacity' => null, + 'single_task_only' => null, + 'startup_grace_period_seconds' => null, 'clone_configuration_from' => null, 'compose_definition' => null, 'image_suffix' => null, @@ -96,6 +100,8 @@ class CreateEnvironmentRequest implements ModelInterface, ArrayAccess, \JsonSeri 'env_name' => false, 'min_capacity' => false, 'max_capacity' => false, + 'single_task_only' => true, + 'startup_grace_period_seconds' => true, 'clone_configuration_from' => false, 'compose_definition' => false, 'image_suffix' => false, @@ -193,6 +199,8 @@ public function isNullableSetToNull(string $property): bool 'env_name' => 'envName', 'min_capacity' => 'minCapacity', 'max_capacity' => 'maxCapacity', + 'single_task_only' => 'singleTaskOnly', + 'startup_grace_period_seconds' => 'startupGracePeriodSeconds', 'clone_configuration_from' => 'cloneConfigurationFrom', 'compose_definition' => 'composeDefinition', 'image_suffix' => 'imageSuffix', @@ -210,6 +218,8 @@ public function isNullableSetToNull(string $property): bool 'env_name' => 'setEnvName', 'min_capacity' => 'setMinCapacity', 'max_capacity' => 'setMaxCapacity', + 'single_task_only' => 'setSingleTaskOnly', + 'startup_grace_period_seconds' => 'setStartupGracePeriodSeconds', 'clone_configuration_from' => 'setCloneConfigurationFrom', 'compose_definition' => 'setComposeDefinition', 'image_suffix' => 'setImageSuffix', @@ -227,6 +237,8 @@ public function isNullableSetToNull(string $property): bool 'env_name' => 'getEnvName', 'min_capacity' => 'getMinCapacity', 'max_capacity' => 'getMaxCapacity', + 'single_task_only' => 'getSingleTaskOnly', + 'startup_grace_period_seconds' => 'getStartupGracePeriodSeconds', 'clone_configuration_from' => 'getCloneConfigurationFrom', 'compose_definition' => 'getComposeDefinition', 'image_suffix' => 'getImageSuffix', @@ -295,6 +307,8 @@ public function __construct(?array $data = null) $this->setIfExists('env_name', $data ?? [], null); $this->setIfExists('min_capacity', $data ?? [], null); $this->setIfExists('max_capacity', $data ?? [], null); + $this->setIfExists('single_task_only', $data ?? [], null); + $this->setIfExists('startup_grace_period_seconds', $data ?? [], 120); $this->setIfExists('clone_configuration_from', $data ?? [], null); $this->setIfExists('compose_definition', $data ?? [], null); $this->setIfExists('image_suffix', $data ?? [], null); @@ -333,6 +347,14 @@ public function listInvalidProperties() if ($this->container['env_name'] === null) { $invalidProperties[] = "'env_name' can't be null"; } + if (!is_null($this->container['startup_grace_period_seconds']) && ($this->container['startup_grace_period_seconds'] > 3600)) { + $invalidProperties[] = "invalid value for 'startup_grace_period_seconds', must be smaller than or equal to 3600."; + } + + if (!is_null($this->container['startup_grace_period_seconds']) && ($this->container['startup_grace_period_seconds'] < 0)) { + $invalidProperties[] = "invalid value for 'startup_grace_period_seconds', must be bigger than or equal to 0."; + } + if (!is_null($this->container['image_suffix']) && !preg_match("/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/", $this->container['image_suffix'])) { $invalidProperties[] = "invalid value for 'image_suffix', must be conform to the pattern /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/."; } @@ -433,6 +455,82 @@ public function setMaxCapacity($max_capacity) return $this; } + /** + * Gets single_task_only + * + * @return bool|null + */ + public function getSingleTaskOnly() + { + return $this->container['single_task_only']; + } + + /** + * Sets single_task_only + * + * @param bool|null $single_task_only Optional. Forces single-task mode (max one running task). When omitted, the platform auto-detects stateful containers. + * + * @return self + */ + public function setSingleTaskOnly($single_task_only) + { + if (is_null($single_task_only)) { + array_push($this->openAPINullablesSetToNull, 'single_task_only'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('single_task_only', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['single_task_only'] = $single_task_only; + + return $this; + } + + /** + * Gets startup_grace_period_seconds + * + * @return int|null + */ + public function getStartupGracePeriodSeconds() + { + return $this->container['startup_grace_period_seconds']; + } + + /** + * Sets startup_grace_period_seconds + * + * @param int|null $startup_grace_period_seconds Optional. Seconds the load balancer waits after a task starts before an unhealthy health check can replace it. If not set, the value from composeDefinition (or default 120) is used. + * + * @return self + */ + public function setStartupGracePeriodSeconds($startup_grace_period_seconds) + { + if (is_null($startup_grace_period_seconds)) { + array_push($this->openAPINullablesSetToNull, 'startup_grace_period_seconds'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startup_grace_period_seconds', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($startup_grace_period_seconds) && ($startup_grace_period_seconds > 3600)) { + throw new \InvalidArgumentException('invalid value for $startup_grace_period_seconds when calling CreateEnvironmentRequest., must be smaller than or equal to 3600.'); + } + if (!is_null($startup_grace_period_seconds) && ($startup_grace_period_seconds < 0)) { + throw new \InvalidArgumentException('invalid value for $startup_grace_period_seconds when calling CreateEnvironmentRequest., must be bigger than or equal to 0.'); + } + + $this->container['startup_grace_period_seconds'] = $startup_grace_period_seconds; + + return $this; + } + /** * Gets clone_configuration_from * diff --git a/src/Model/CreateEnvironmentRequestEnvironmentInner.php b/src/Model/CreateEnvironmentRequestEnvironmentInner.php index 87056e9a..d0791cf8 100644 --- a/src/Model/CreateEnvironmentRequestEnvironmentInner.php +++ b/src/Model/CreateEnvironmentRequestEnvironmentInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateFilterPolicyRequest.php b/src/Model/CreateFilterPolicyRequest.php new file mode 100644 index 00000000..4142ebd0 --- /dev/null +++ b/src/Model/CreateFilterPolicyRequest.php @@ -0,0 +1,555 @@ + + */ +class CreateFilterPolicyRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'createFilterPolicy_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'description' => 'string', + 'enabled' => 'bool', + 'rules' => '\QuantClient\Model\CreateFilterPolicyRequestRulesInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'description' => null, + 'enabled' => null, + 'rules' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'description' => true, + 'enabled' => false, + 'rules' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'description' => 'description', + 'enabled' => 'enabled', + 'rules' => 'rules' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'enabled' => 'setEnabled', + 'rules' => 'setRules' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'enabled' => 'getEnabled', + 'rules' => 'getRules' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) > 255)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 1000)) { + $invalidProperties[] = "invalid value for 'description', the character length must be smaller than or equal to 1000."; + } + + if ($this->container['rules'] === null) { + $invalidProperties[] = "'rules' can't be null"; + } + if ((count($this->container['rules']) > 100)) { + $invalidProperties[] = "invalid value for 'rules', number of items must be less than or equal to 100."; + } + + if ((count($this->container['rules']) < 1)) { + $invalidProperties[] = "invalid value for 'rules', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + if ((mb_strlen($name) > 255)) { + throw new \InvalidArgumentException('invalid length for $name when calling CreateFilterPolicyRequest., must be smaller than or equal to 255.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($description) && (mb_strlen($description) > 1000)) { + throw new \InvalidArgumentException('invalid length for $description when calling CreateFilterPolicyRequest., must be smaller than or equal to 1000.'); + } + + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled enabled + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets rules + * + * @return \QuantClient\Model\CreateFilterPolicyRequestRulesInner[] + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \QuantClient\Model\CreateFilterPolicyRequestRulesInner[] $rules rules + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + throw new \InvalidArgumentException('non-nullable rules cannot be null'); + } + + if ((count($rules) > 100)) { + throw new \InvalidArgumentException('invalid value for $rules when calling CreateFilterPolicyRequest., number of items must be less than or equal to 100.'); + } + if ((count($rules) < 1)) { + throw new \InvalidArgumentException('invalid length for $rules when calling CreateFilterPolicyRequest., number of items must be greater than or equal to 1.'); + } + $this->container['rules'] = $rules; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CreateFilterPolicyRequestRulesInner.php b/src/Model/CreateFilterPolicyRequestRulesInner.php new file mode 100644 index 00000000..c3156b21 --- /dev/null +++ b/src/Model/CreateFilterPolicyRequestRulesInner.php @@ -0,0 +1,581 @@ + + */ +class CreateFilterPolicyRequestRulesInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'createFilterPolicy_request_rules_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'match' => '\QuantClient\Model\CreateFilterPolicyRequestRulesInnerMatch', + 'action' => 'string', + 'apply_to' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'match' => null, + 'action' => null, + 'apply_to' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'match' => false, + 'action' => false, + 'apply_to' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'match' => 'match', + 'action' => 'action', + 'apply_to' => 'applyTo' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'match' => 'setMatch', + 'action' => 'setAction', + 'apply_to' => 'setApplyTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'match' => 'getMatch', + 'action' => 'getAction', + 'apply_to' => 'getApplyTo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const ACTION_BLOCK = 'BLOCK'; + public const ACTION_REDACT = 'REDACT'; + public const APPLY_TO_INPUT = 'input'; + public const APPLY_TO_OUTPUT = 'output'; + public const APPLY_TO_BOTH = 'both'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getActionAllowableValues() + { + return [ + self::ACTION_BLOCK, + self::ACTION_REDACT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getApplyToAllowableValues() + { + return [ + self::APPLY_TO_INPUT, + self::APPLY_TO_OUTPUT, + self::APPLY_TO_BOTH, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('match', $data ?? [], null); + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('apply_to', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getActionAllowableValues(); + if (!is_null($this->container['action']) && !in_array($this->container['action'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'action', must be one of '%s'", + $this->container['action'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getApplyToAllowableValues(); + if (!is_null($this->container['apply_to']) && !in_array($this->container['apply_to'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'apply_to', must be one of '%s'", + $this->container['apply_to'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets match + * + * @return \QuantClient\Model\CreateFilterPolicyRequestRulesInnerMatch|null + */ + public function getMatch() + { + return $this->container['match']; + } + + /** + * Sets match + * + * @param \QuantClient\Model\CreateFilterPolicyRequestRulesInnerMatch|null $match match + * + * @return self + */ + public function setMatch($match) + { + if (is_null($match)) { + throw new \InvalidArgumentException('non-nullable match cannot be null'); + } + $this->container['match'] = $match; + + return $this; + } + + /** + * Gets action + * + * @return string|null + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string|null $action action + * + * @return self + */ + public function setAction($action) + { + if (is_null($action)) { + throw new \InvalidArgumentException('non-nullable action cannot be null'); + } + $allowedValues = $this->getActionAllowableValues(); + if (!in_array($action, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'action', must be one of '%s'", + $action, + implode("', '", $allowedValues) + ) + ); + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets apply_to + * + * @return string|null + */ + public function getApplyTo() + { + return $this->container['apply_to']; + } + + /** + * Sets apply_to + * + * @param string|null $apply_to apply_to + * + * @return self + */ + public function setApplyTo($apply_to) + { + if (is_null($apply_to)) { + throw new \InvalidArgumentException('non-nullable apply_to cannot be null'); + } + $allowedValues = $this->getApplyToAllowableValues(); + if (!in_array($apply_to, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'apply_to', must be one of '%s'", + $apply_to, + implode("', '", $allowedValues) + ) + ); + } + $this->container['apply_to'] = $apply_to; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CreateFilterPolicyRequestRulesInnerMatch.php b/src/Model/CreateFilterPolicyRequestRulesInnerMatch.php new file mode 100644 index 00000000..0405ec05 --- /dev/null +++ b/src/Model/CreateFilterPolicyRequestRulesInnerMatch.php @@ -0,0 +1,520 @@ + + */ +class CreateFilterPolicyRequestRulesInnerMatch implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'createFilterPolicy_request_rules_inner_match'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'values' => 'string[]', + 'pattern' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'values' => null, + 'pattern' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'values' => false, + 'pattern' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'values' => 'values', + 'pattern' => 'pattern' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'values' => 'setValues', + 'pattern' => 'setPattern' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'values' => 'getValues', + 'pattern' => 'getPattern' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_WORD = 'word'; + public const TYPE_REGEX = 'regex'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_WORD, + self::TYPE_REGEX, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); + $this->setIfExists('pattern', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['pattern']) && (mb_strlen($this->container['pattern']) > 500)) { + $invalidProperties[] = "invalid value for 'pattern', the character length must be smaller than or equal to 500."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets values + * + * @return string[]|null + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param string[]|null $values Required when type=word + * + * @return self + */ + public function setValues($values) + { + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); + } + $this->container['values'] = $values; + + return $this; + } + + /** + * Gets pattern + * + * @return string|null + */ + public function getPattern() + { + return $this->container['pattern']; + } + + /** + * Sets pattern + * + * @param string|null $pattern Required when type=regex + * + * @return self + */ + public function setPattern($pattern) + { + if (is_null($pattern)) { + throw new \InvalidArgumentException('non-nullable pattern cannot be null'); + } + if ((mb_strlen($pattern) > 500)) { + throw new \InvalidArgumentException('invalid length for $pattern when calling CreateFilterPolicyRequestRulesInnerMatch., must be smaller than or equal to 500.'); + } + + $this->container['pattern'] = $pattern; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CreateOrchestrationRequest.php b/src/Model/CreateOrchestrationRequest.php new file mode 100644 index 00000000..28f02682 --- /dev/null +++ b/src/Model/CreateOrchestrationRequest.php @@ -0,0 +1,856 @@ + + */ +class CreateOrchestrationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'createOrchestration_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'description' => 'string', + 'agent_id' => 'string', + 'tool_id' => 'string', + 'workflow_id' => 'string', + 'input_source' => '\QuantClient\Model\CreateOrchestrationRequestInputSource', + 'batch_size' => 'int', + 'concurrency' => 'int', + 'stop_condition' => '\QuantClient\Model\CreateOrchestrationRequestStopCondition', + 'assigned_skills' => 'string[]', + 'context' => 'object', + 'auto_start' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'description' => null, + 'agent_id' => null, + 'tool_id' => null, + 'workflow_id' => null, + 'input_source' => null, + 'batch_size' => null, + 'concurrency' => null, + 'stop_condition' => null, + 'assigned_skills' => null, + 'context' => null, + 'auto_start' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'description' => true, + 'agent_id' => true, + 'tool_id' => true, + 'workflow_id' => true, + 'input_source' => false, + 'batch_size' => false, + 'concurrency' => false, + 'stop_condition' => false, + 'assigned_skills' => false, + 'context' => true, + 'auto_start' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'description' => 'description', + 'agent_id' => 'agentId', + 'tool_id' => 'toolId', + 'workflow_id' => 'workflowId', + 'input_source' => 'inputSource', + 'batch_size' => 'batchSize', + 'concurrency' => 'concurrency', + 'stop_condition' => 'stopCondition', + 'assigned_skills' => 'assignedSkills', + 'context' => 'context', + 'auto_start' => 'autoStart' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'agent_id' => 'setAgentId', + 'tool_id' => 'setToolId', + 'workflow_id' => 'setWorkflowId', + 'input_source' => 'setInputSource', + 'batch_size' => 'setBatchSize', + 'concurrency' => 'setConcurrency', + 'stop_condition' => 'setStopCondition', + 'assigned_skills' => 'setAssignedSkills', + 'context' => 'setContext', + 'auto_start' => 'setAutoStart' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'agent_id' => 'getAgentId', + 'tool_id' => 'getToolId', + 'workflow_id' => 'getWorkflowId', + 'input_source' => 'getInputSource', + 'batch_size' => 'getBatchSize', + 'concurrency' => 'getConcurrency', + 'stop_condition' => 'getStopCondition', + 'assigned_skills' => 'getAssignedSkills', + 'context' => 'getContext', + 'auto_start' => 'getAutoStart' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('agent_id', $data ?? [], null); + $this->setIfExists('tool_id', $data ?? [], null); + $this->setIfExists('workflow_id', $data ?? [], null); + $this->setIfExists('input_source', $data ?? [], null); + $this->setIfExists('batch_size', $data ?? [], 10); + $this->setIfExists('concurrency', $data ?? [], 1); + $this->setIfExists('stop_condition', $data ?? [], null); + $this->setIfExists('assigned_skills', $data ?? [], null); + $this->setIfExists('context', $data ?? [], null); + $this->setIfExists('auto_start', $data ?? [], true); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['input_source'] === null) { + $invalidProperties[] = "'input_source' can't be null"; + } + if (!is_null($this->container['batch_size']) && ($this->container['batch_size'] > 100)) { + $invalidProperties[] = "invalid value for 'batch_size', must be smaller than or equal to 100."; + } + + if (!is_null($this->container['batch_size']) && ($this->container['batch_size'] < 1)) { + $invalidProperties[] = "invalid value for 'batch_size', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['concurrency']) && ($this->container['concurrency'] > 10)) { + $invalidProperties[] = "invalid value for 'concurrency', must be smaller than or equal to 10."; + } + + if (!is_null($this->container['concurrency']) && ($this->container['concurrency'] < 1)) { + $invalidProperties[] = "invalid value for 'concurrency', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Orchestration name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Optional description + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets agent_id + * + * @return string|null + */ + public function getAgentId() + { + return $this->container['agent_id']; + } + + /** + * Sets agent_id + * + * @param string|null $agent_id Agent to process items + * + * @return self + */ + public function setAgentId($agent_id) + { + if (is_null($agent_id)) { + array_push($this->openAPINullablesSetToNull, 'agent_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('agent_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['agent_id'] = $agent_id; + + return $this; + } + + /** + * Gets tool_id + * + * @return string|null + */ + public function getToolId() + { + return $this->container['tool_id']; + } + + /** + * Sets tool_id + * + * @param string|null $tool_id Tool to execute for items + * + * @return self + */ + public function setToolId($tool_id) + { + if (is_null($tool_id)) { + array_push($this->openAPINullablesSetToNull, 'tool_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tool_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tool_id'] = $tool_id; + + return $this; + } + + /** + * Gets workflow_id + * + * @return string|null + */ + public function getWorkflowId() + { + return $this->container['workflow_id']; + } + + /** + * Sets workflow_id + * + * @param string|null $workflow_id Workflow to run for items + * + * @return self + */ + public function setWorkflowId($workflow_id) + { + if (is_null($workflow_id)) { + array_push($this->openAPINullablesSetToNull, 'workflow_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('workflow_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['workflow_id'] = $workflow_id; + + return $this; + } + + /** + * Gets input_source + * + * @return \QuantClient\Model\CreateOrchestrationRequestInputSource + */ + public function getInputSource() + { + return $this->container['input_source']; + } + + /** + * Sets input_source + * + * @param \QuantClient\Model\CreateOrchestrationRequestInputSource $input_source input_source + * + * @return self + */ + public function setInputSource($input_source) + { + if (is_null($input_source)) { + throw new \InvalidArgumentException('non-nullable input_source cannot be null'); + } + $this->container['input_source'] = $input_source; + + return $this; + } + + /** + * Gets batch_size + * + * @return int|null + */ + public function getBatchSize() + { + return $this->container['batch_size']; + } + + /** + * Sets batch_size + * + * @param int|null $batch_size Items per batch + * + * @return self + */ + public function setBatchSize($batch_size) + { + if (is_null($batch_size)) { + throw new \InvalidArgumentException('non-nullable batch_size cannot be null'); + } + + if (($batch_size > 100)) { + throw new \InvalidArgumentException('invalid value for $batch_size when calling CreateOrchestrationRequest., must be smaller than or equal to 100.'); + } + if (($batch_size < 1)) { + throw new \InvalidArgumentException('invalid value for $batch_size when calling CreateOrchestrationRequest., must be bigger than or equal to 1.'); + } + + $this->container['batch_size'] = $batch_size; + + return $this; + } + + /** + * Gets concurrency + * + * @return int|null + */ + public function getConcurrency() + { + return $this->container['concurrency']; + } + + /** + * Sets concurrency + * + * @param int|null $concurrency Concurrent items within a batch + * + * @return self + */ + public function setConcurrency($concurrency) + { + if (is_null($concurrency)) { + throw new \InvalidArgumentException('non-nullable concurrency cannot be null'); + } + + if (($concurrency > 10)) { + throw new \InvalidArgumentException('invalid value for $concurrency when calling CreateOrchestrationRequest., must be smaller than or equal to 10.'); + } + if (($concurrency < 1)) { + throw new \InvalidArgumentException('invalid value for $concurrency when calling CreateOrchestrationRequest., must be bigger than or equal to 1.'); + } + + $this->container['concurrency'] = $concurrency; + + return $this; + } + + /** + * Gets stop_condition + * + * @return \QuantClient\Model\CreateOrchestrationRequestStopCondition|null + */ + public function getStopCondition() + { + return $this->container['stop_condition']; + } + + /** + * Sets stop_condition + * + * @param \QuantClient\Model\CreateOrchestrationRequestStopCondition|null $stop_condition stop_condition + * + * @return self + */ + public function setStopCondition($stop_condition) + { + if (is_null($stop_condition)) { + throw new \InvalidArgumentException('non-nullable stop_condition cannot be null'); + } + $this->container['stop_condition'] = $stop_condition; + + return $this; + } + + /** + * Gets assigned_skills + * + * @return string[]|null + */ + public function getAssignedSkills() + { + return $this->container['assigned_skills']; + } + + /** + * Sets assigned_skills + * + * @param string[]|null $assigned_skills Skill IDs to assign + * + * @return self + */ + public function setAssignedSkills($assigned_skills) + { + if (is_null($assigned_skills)) { + throw new \InvalidArgumentException('non-nullable assigned_skills cannot be null'); + } + $this->container['assigned_skills'] = $assigned_skills; + + return $this; + } + + /** + * Gets context + * + * @return object|null + */ + public function getContext() + { + return $this->container['context']; + } + + /** + * Sets context + * + * @param object|null $context Optional context merged into each item before processing (e.g. shared credentials or endpoints) + * + * @return self + */ + public function setContext($context) + { + if (is_null($context)) { + array_push($this->openAPINullablesSetToNull, 'context'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('context', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['context'] = $context; + + return $this; + } + + /** + * Gets auto_start + * + * @return bool|null + */ + public function getAutoStart() + { + return $this->container['auto_start']; + } + + /** + * Sets auto_start + * + * @param bool|null $auto_start Whether to start immediately + * + * @return self + */ + public function setAutoStart($auto_start) + { + if (is_null($auto_start)) { + throw new \InvalidArgumentException('non-nullable auto_start cannot be null'); + } + $this->container['auto_start'] = $auto_start; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CreateOrchestrationRequestInputSource.php b/src/Model/CreateOrchestrationRequestInputSource.php new file mode 100644 index 00000000..ff3157ec --- /dev/null +++ b/src/Model/CreateOrchestrationRequestInputSource.php @@ -0,0 +1,550 @@ + + */ +class CreateOrchestrationRequestInputSource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'createOrchestration_request_inputSource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'items' => 'object[]', + 'task_query' => 'object', + 'generator_prompt' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'items' => null, + 'task_query' => null, + 'generator_prompt' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'items' => false, + 'task_query' => false, + 'generator_prompt' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'items' => 'items', + 'task_query' => 'taskQuery', + 'generator_prompt' => 'generatorPrompt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'items' => 'setItems', + 'task_query' => 'setTaskQuery', + 'generator_prompt' => 'setGeneratorPrompt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'items' => 'getItems', + 'task_query' => 'getTaskQuery', + 'generator_prompt' => 'getGeneratorPrompt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE__STATIC = 'static'; + public const TYPE_TASK_QUERY = 'task_query'; + public const TYPE_GENERATOR = 'generator'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE__STATIC, + self::TYPE_TASK_QUERY, + self::TYPE_GENERATOR, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('task_query', $data ?? [], null); + $this->setIfExists('generator_prompt', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Input source type (api type not yet supported) + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets items + * + * @return object[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param object[]|null $items Static items (for type=static) + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + throw new \InvalidArgumentException('non-nullable items cannot be null'); + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets task_query + * + * @return object|null + */ + public function getTaskQuery() + { + return $this->container['task_query']; + } + + /** + * Sets task_query + * + * @param object|null $task_query Task query filters (for type=task_query) + * + * @return self + */ + public function setTaskQuery($task_query) + { + if (is_null($task_query)) { + throw new \InvalidArgumentException('non-nullable task_query cannot be null'); + } + $this->container['task_query'] = $task_query; + + return $this; + } + + /** + * Gets generator_prompt + * + * @return string|null + */ + public function getGeneratorPrompt() + { + return $this->container['generator_prompt']; + } + + /** + * Sets generator_prompt + * + * @param string|null $generator_prompt AI prompt (for type=generator) + * + * @return self + */ + public function setGeneratorPrompt($generator_prompt) + { + if (is_null($generator_prompt)) { + throw new \InvalidArgumentException('non-nullable generator_prompt cannot be null'); + } + $this->container['generator_prompt'] = $generator_prompt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CreateOrchestrationRequestStopCondition.php b/src/Model/CreateOrchestrationRequestStopCondition.php new file mode 100644 index 00000000..1e9c9a03 --- /dev/null +++ b/src/Model/CreateOrchestrationRequestStopCondition.php @@ -0,0 +1,524 @@ + + */ +class CreateOrchestrationRequestStopCondition implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'createOrchestration_request_stopCondition'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'max_iterations' => 'int', + 'condition_prompt' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'max_iterations' => null, + 'condition_prompt' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'max_iterations' => false, + 'condition_prompt' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'max_iterations' => 'maxIterations', + 'condition_prompt' => 'conditionPrompt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'max_iterations' => 'setMaxIterations', + 'condition_prompt' => 'setConditionPrompt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'max_iterations' => 'getMaxIterations', + 'condition_prompt' => 'getConditionPrompt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_ALL_COMPLETE = 'all_complete'; + public const TYPE_MAX_ITERATIONS = 'max_iterations'; + public const TYPE_CONDITION = 'condition'; + public const TYPE_MANUAL = 'manual'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ALL_COMPLETE, + self::TYPE_MAX_ITERATIONS, + self::TYPE_CONDITION, + self::TYPE_MANUAL, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], 'all_complete'); + $this->setIfExists('max_iterations', $data ?? [], null); + $this->setIfExists('condition_prompt', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['max_iterations']) && ($this->container['max_iterations'] < 1)) { + $invalidProperties[] = "invalid value for 'max_iterations', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets max_iterations + * + * @return int|null + */ + public function getMaxIterations() + { + return $this->container['max_iterations']; + } + + /** + * Sets max_iterations + * + * @param int|null $max_iterations Max iterations (for type=max_iterations) + * + * @return self + */ + public function setMaxIterations($max_iterations) + { + if (is_null($max_iterations)) { + throw new \InvalidArgumentException('non-nullable max_iterations cannot be null'); + } + + if (($max_iterations < 1)) { + throw new \InvalidArgumentException('invalid value for $max_iterations when calling CreateOrchestrationRequestStopCondition., must be bigger than or equal to 1.'); + } + + $this->container['max_iterations'] = $max_iterations; + + return $this; + } + + /** + * Gets condition_prompt + * + * @return string|null + */ + public function getConditionPrompt() + { + return $this->container['condition_prompt']; + } + + /** + * Sets condition_prompt + * + * @param string|null $condition_prompt AI prompt to evaluate stop (for type=condition) + * + * @return self + */ + public function setConditionPrompt($condition_prompt) + { + if (is_null($condition_prompt)) { + throw new \InvalidArgumentException('non-nullable condition_prompt cannot be null'); + } + $this->container['condition_prompt'] = $condition_prompt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CreateSkill201Response.php b/src/Model/CreateSkill201Response.php new file mode 100644 index 00000000..bb3b399e --- /dev/null +++ b/src/Model/CreateSkill201Response.php @@ -0,0 +1,477 @@ + + */ +class CreateSkill201Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'createSkill_201_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'success' => 'bool', + 'skill' => 'object', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'skill' => null, + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'success' => false, + 'skill' => false, + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'skill' => 'skill', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'skill' => 'setSkill', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'skill' => 'getSkill', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('success', $data ?? [], null); + $this->setIfExists('skill', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success) + { + if (is_null($success)) { + throw new \InvalidArgumentException('non-nullable success cannot be null'); + } + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets skill + * + * @return object|null + */ + public function getSkill() + { + return $this->container['skill']; + } + + /** + * Sets skill + * + * @param object|null $skill skill + * + * @return self + */ + public function setSkill($skill) + { + if (is_null($skill)) { + throw new \InvalidArgumentException('non-nullable skill cannot be null'); + } + $this->container['skill'] = $skill; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CreateSkillRequest.php b/src/Model/CreateSkillRequest.php new file mode 100644 index 00000000..1b746053 --- /dev/null +++ b/src/Model/CreateSkillRequest.php @@ -0,0 +1,758 @@ + + */ +class CreateSkillRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'createSkill_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'description' => 'string', + 'content' => 'string', + 'trigger_condition' => 'string', + 'tags' => 'string[]', + 'required_tools' => 'string[]', + 'namespace' => 'string', + 'files' => 'object', + 'disable_model_invocation' => 'bool', + 'allowed_tools' => 'string[]', + 'installed_by' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'description' => null, + 'content' => null, + 'trigger_condition' => null, + 'tags' => null, + 'required_tools' => null, + 'namespace' => null, + 'files' => null, + 'disable_model_invocation' => null, + 'allowed_tools' => null, + 'installed_by' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'description' => false, + 'content' => false, + 'trigger_condition' => false, + 'tags' => false, + 'required_tools' => false, + 'namespace' => false, + 'files' => false, + 'disable_model_invocation' => false, + 'allowed_tools' => false, + 'installed_by' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'description' => 'description', + 'content' => 'content', + 'trigger_condition' => 'triggerCondition', + 'tags' => 'tags', + 'required_tools' => 'requiredTools', + 'namespace' => 'namespace', + 'files' => 'files', + 'disable_model_invocation' => 'disableModelInvocation', + 'allowed_tools' => 'allowedTools', + 'installed_by' => 'installedBy' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'content' => 'setContent', + 'trigger_condition' => 'setTriggerCondition', + 'tags' => 'setTags', + 'required_tools' => 'setRequiredTools', + 'namespace' => 'setNamespace', + 'files' => 'setFiles', + 'disable_model_invocation' => 'setDisableModelInvocation', + 'allowed_tools' => 'setAllowedTools', + 'installed_by' => 'setInstalledBy' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'content' => 'getContent', + 'trigger_condition' => 'getTriggerCondition', + 'tags' => 'getTags', + 'required_tools' => 'getRequiredTools', + 'namespace' => 'getNamespace', + 'files' => 'getFiles', + 'disable_model_invocation' => 'getDisableModelInvocation', + 'allowed_tools' => 'getAllowedTools', + 'installed_by' => 'getInstalledBy' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('trigger_condition', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('required_tools', $data ?? [], null); + $this->setIfExists('namespace', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('disable_model_invocation', $data ?? [], null); + $this->setIfExists('allowed_tools', $data ?? [], null); + $this->setIfExists('installed_by', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['content'] === null) { + $invalidProperties[] = "'content' can't be null"; + } + if ($this->container['trigger_condition'] === null) { + $invalidProperties[] = "'trigger_condition' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content content + * + * @return self + */ + public function setContent($content) + { + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets trigger_condition + * + * @return string + */ + public function getTriggerCondition() + { + return $this->container['trigger_condition']; + } + + /** + * Sets trigger_condition + * + * @param string $trigger_condition trigger_condition + * + * @return self + */ + public function setTriggerCondition($trigger_condition) + { + if (is_null($trigger_condition)) { + throw new \InvalidArgumentException('non-nullable trigger_condition cannot be null'); + } + $this->container['trigger_condition'] = $trigger_condition; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return self + */ + public function setTags($tags) + { + if (is_null($tags)) { + throw new \InvalidArgumentException('non-nullable tags cannot be null'); + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets required_tools + * + * @return string[]|null + */ + public function getRequiredTools() + { + return $this->container['required_tools']; + } + + /** + * Sets required_tools + * + * @param string[]|null $required_tools required_tools + * + * @return self + */ + public function setRequiredTools($required_tools) + { + if (is_null($required_tools)) { + throw new \InvalidArgumentException('non-nullable required_tools cannot be null'); + } + $this->container['required_tools'] = $required_tools; + + return $this; + } + + /** + * Gets namespace + * + * @return string|null + */ + public function getNamespace() + { + return $this->container['namespace']; + } + + /** + * Sets namespace + * + * @param string|null $namespace namespace + * + * @return self + */ + public function setNamespace($namespace) + { + if (is_null($namespace)) { + throw new \InvalidArgumentException('non-nullable namespace cannot be null'); + } + $this->container['namespace'] = $namespace; + + return $this; + } + + /** + * Gets files + * + * @return object|null + */ + public function getFiles() + { + return $this->container['files']; + } + + /** + * Sets files + * + * @param object|null $files files + * + * @return self + */ + public function setFiles($files) + { + if (is_null($files)) { + throw new \InvalidArgumentException('non-nullable files cannot be null'); + } + $this->container['files'] = $files; + + return $this; + } + + /** + * Gets disable_model_invocation + * + * @return bool|null + */ + public function getDisableModelInvocation() + { + return $this->container['disable_model_invocation']; + } + + /** + * Sets disable_model_invocation + * + * @param bool|null $disable_model_invocation disable_model_invocation + * + * @return self + */ + public function setDisableModelInvocation($disable_model_invocation) + { + if (is_null($disable_model_invocation)) { + throw new \InvalidArgumentException('non-nullable disable_model_invocation cannot be null'); + } + $this->container['disable_model_invocation'] = $disable_model_invocation; + + return $this; + } + + /** + * Gets allowed_tools + * + * @return string[]|null + */ + public function getAllowedTools() + { + return $this->container['allowed_tools']; + } + + /** + * Sets allowed_tools + * + * @param string[]|null $allowed_tools allowed_tools + * + * @return self + */ + public function setAllowedTools($allowed_tools) + { + if (is_null($allowed_tools)) { + throw new \InvalidArgumentException('non-nullable allowed_tools cannot be null'); + } + $this->container['allowed_tools'] = $allowed_tools; + + return $this; + } + + /** + * Gets installed_by + * + * @return string|null + */ + public function getInstalledBy() + { + return $this->container['installed_by']; + } + + /** + * Sets installed_by + * + * @param string|null $installed_by installed_by + * + * @return self + */ + public function setInstalledBy($installed_by) + { + if (is_null($installed_by)) { + throw new \InvalidArgumentException('non-nullable installed_by cannot be null'); + } + $this->container['installed_by'] = $installed_by; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CreateSlackBot201Response.php b/src/Model/CreateSlackBot201Response.php new file mode 100644 index 00000000..bc88b2dc --- /dev/null +++ b/src/Model/CreateSlackBot201Response.php @@ -0,0 +1,409 @@ + + */ +class CreateSlackBot201Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'createSlackBot_201_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bot' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bot' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'bot' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'bot' => 'bot' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bot' => 'setBot' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bot' => 'getBot' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('bot', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bot + * + * @return object|null + */ + public function getBot() + { + return $this->container['bot']; + } + + /** + * Sets bot + * + * @param object|null $bot bot + * + * @return self + */ + public function setBot($bot) + { + if (is_null($bot)) { + throw new \InvalidArgumentException('non-nullable bot cannot be null'); + } + $this->container['bot'] = $bot; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CreateSlackBotRequest.php b/src/Model/CreateSlackBotRequest.php new file mode 100644 index 00000000..6e72b923 --- /dev/null +++ b/src/Model/CreateSlackBotRequest.php @@ -0,0 +1,1210 @@ + + */ +class CreateSlackBotRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'createSlackBot_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'setup_type' => 'string', + 'system_prompt' => 'string', + 'model_id' => 'string', + 'temperature' => 'float', + 'max_tokens' => 'int', + 'allowed_tools' => 'string[]', + 'assigned_skills' => 'string[]', + 'allowed_collections' => 'string[]', + 'allowed_sub_agents' => 'string[]', + 'guardrail_preset' => 'string', + 'filter_policies' => 'string[]', + 'long_context' => 'bool', + 'session_ttl_days' => 'int', + 'allowed_channels' => 'string[]', + 'allowed_users' => 'string[]', + 'denied_users' => 'string[]', + 'allow_guests' => 'bool', + 'home_tab_content' => 'string', + 'agent_access_control' => 'object', + 'keywords_enabled' => 'bool', + 'keywords' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'setup_type' => null, + 'system_prompt' => null, + 'model_id' => null, + 'temperature' => null, + 'max_tokens' => null, + 'allowed_tools' => null, + 'assigned_skills' => null, + 'allowed_collections' => null, + 'allowed_sub_agents' => null, + 'guardrail_preset' => null, + 'filter_policies' => null, + 'long_context' => null, + 'session_ttl_days' => null, + 'allowed_channels' => null, + 'allowed_users' => null, + 'denied_users' => null, + 'allow_guests' => null, + 'home_tab_content' => null, + 'agent_access_control' => null, + 'keywords_enabled' => null, + 'keywords' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'setup_type' => false, + 'system_prompt' => false, + 'model_id' => false, + 'temperature' => false, + 'max_tokens' => false, + 'allowed_tools' => false, + 'assigned_skills' => false, + 'allowed_collections' => false, + 'allowed_sub_agents' => false, + 'guardrail_preset' => false, + 'filter_policies' => false, + 'long_context' => false, + 'session_ttl_days' => false, + 'allowed_channels' => false, + 'allowed_users' => false, + 'denied_users' => false, + 'allow_guests' => false, + 'home_tab_content' => false, + 'agent_access_control' => false, + 'keywords_enabled' => false, + 'keywords' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'setup_type' => 'setupType', + 'system_prompt' => 'systemPrompt', + 'model_id' => 'modelId', + 'temperature' => 'temperature', + 'max_tokens' => 'maxTokens', + 'allowed_tools' => 'allowedTools', + 'assigned_skills' => 'assignedSkills', + 'allowed_collections' => 'allowedCollections', + 'allowed_sub_agents' => 'allowedSubAgents', + 'guardrail_preset' => 'guardrailPreset', + 'filter_policies' => 'filterPolicies', + 'long_context' => 'longContext', + 'session_ttl_days' => 'sessionTtlDays', + 'allowed_channels' => 'allowedChannels', + 'allowed_users' => 'allowedUsers', + 'denied_users' => 'deniedUsers', + 'allow_guests' => 'allowGuests', + 'home_tab_content' => 'homeTabContent', + 'agent_access_control' => 'agentAccessControl', + 'keywords_enabled' => 'keywordsEnabled', + 'keywords' => 'keywords' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'setup_type' => 'setSetupType', + 'system_prompt' => 'setSystemPrompt', + 'model_id' => 'setModelId', + 'temperature' => 'setTemperature', + 'max_tokens' => 'setMaxTokens', + 'allowed_tools' => 'setAllowedTools', + 'assigned_skills' => 'setAssignedSkills', + 'allowed_collections' => 'setAllowedCollections', + 'allowed_sub_agents' => 'setAllowedSubAgents', + 'guardrail_preset' => 'setGuardrailPreset', + 'filter_policies' => 'setFilterPolicies', + 'long_context' => 'setLongContext', + 'session_ttl_days' => 'setSessionTtlDays', + 'allowed_channels' => 'setAllowedChannels', + 'allowed_users' => 'setAllowedUsers', + 'denied_users' => 'setDeniedUsers', + 'allow_guests' => 'setAllowGuests', + 'home_tab_content' => 'setHomeTabContent', + 'agent_access_control' => 'setAgentAccessControl', + 'keywords_enabled' => 'setKeywordsEnabled', + 'keywords' => 'setKeywords' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'setup_type' => 'getSetupType', + 'system_prompt' => 'getSystemPrompt', + 'model_id' => 'getModelId', + 'temperature' => 'getTemperature', + 'max_tokens' => 'getMaxTokens', + 'allowed_tools' => 'getAllowedTools', + 'assigned_skills' => 'getAssignedSkills', + 'allowed_collections' => 'getAllowedCollections', + 'allowed_sub_agents' => 'getAllowedSubAgents', + 'guardrail_preset' => 'getGuardrailPreset', + 'filter_policies' => 'getFilterPolicies', + 'long_context' => 'getLongContext', + 'session_ttl_days' => 'getSessionTtlDays', + 'allowed_channels' => 'getAllowedChannels', + 'allowed_users' => 'getAllowedUsers', + 'denied_users' => 'getDeniedUsers', + 'allow_guests' => 'getAllowGuests', + 'home_tab_content' => 'getHomeTabContent', + 'agent_access_control' => 'getAgentAccessControl', + 'keywords_enabled' => 'getKeywordsEnabled', + 'keywords' => 'getKeywords' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const SETUP_TYPE_QUANT = 'quant'; + public const SETUP_TYPE_BYO = 'byo'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSetupTypeAllowableValues() + { + return [ + self::SETUP_TYPE_QUANT, + self::SETUP_TYPE_BYO, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('setup_type', $data ?? [], null); + $this->setIfExists('system_prompt', $data ?? [], null); + $this->setIfExists('model_id', $data ?? [], null); + $this->setIfExists('temperature', $data ?? [], null); + $this->setIfExists('max_tokens', $data ?? [], null); + $this->setIfExists('allowed_tools', $data ?? [], null); + $this->setIfExists('assigned_skills', $data ?? [], null); + $this->setIfExists('allowed_collections', $data ?? [], null); + $this->setIfExists('allowed_sub_agents', $data ?? [], null); + $this->setIfExists('guardrail_preset', $data ?? [], null); + $this->setIfExists('filter_policies', $data ?? [], null); + $this->setIfExists('long_context', $data ?? [], null); + $this->setIfExists('session_ttl_days', $data ?? [], null); + $this->setIfExists('allowed_channels', $data ?? [], null); + $this->setIfExists('allowed_users', $data ?? [], null); + $this->setIfExists('denied_users', $data ?? [], null); + $this->setIfExists('allow_guests', $data ?? [], null); + $this->setIfExists('home_tab_content', $data ?? [], null); + $this->setIfExists('agent_access_control', $data ?? [], null); + $this->setIfExists('keywords_enabled', $data ?? [], null); + $this->setIfExists('keywords', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['setup_type'] === null) { + $invalidProperties[] = "'setup_type' can't be null"; + } + $allowedValues = $this->getSetupTypeAllowableValues(); + if (!is_null($this->container['setup_type']) && !in_array($this->container['setup_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'setup_type', must be one of '%s'", + $this->container['setup_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['system_prompt'] === null) { + $invalidProperties[] = "'system_prompt' can't be null"; + } + if ($this->container['model_id'] === null) { + $invalidProperties[] = "'model_id' can't be null"; + } + if (!is_null($this->container['temperature']) && ($this->container['temperature'] > 2)) { + $invalidProperties[] = "invalid value for 'temperature', must be smaller than or equal to 2."; + } + + if (!is_null($this->container['temperature']) && ($this->container['temperature'] < 0)) { + $invalidProperties[] = "invalid value for 'temperature', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['max_tokens']) && ($this->container['max_tokens'] < 1)) { + $invalidProperties[] = "invalid value for 'max_tokens', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['session_ttl_days']) && ($this->container['session_ttl_days'] > 90)) { + $invalidProperties[] = "invalid value for 'session_ttl_days', must be smaller than or equal to 90."; + } + + if (!is_null($this->container['session_ttl_days']) && ($this->container['session_ttl_days'] < 1)) { + $invalidProperties[] = "invalid value for 'session_ttl_days', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Display name for the bot + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets setup_type + * + * @return string + */ + public function getSetupType() + { + return $this->container['setup_type']; + } + + /** + * Sets setup_type + * + * @param string $setup_type Whether to use Quant-managed or customer-provided Slack app + * + * @return self + */ + public function setSetupType($setup_type) + { + if (is_null($setup_type)) { + throw new \InvalidArgumentException('non-nullable setup_type cannot be null'); + } + $allowedValues = $this->getSetupTypeAllowableValues(); + if (!in_array($setup_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'setup_type', must be one of '%s'", + $setup_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['setup_type'] = $setup_type; + + return $this; + } + + /** + * Gets system_prompt + * + * @return string + */ + public function getSystemPrompt() + { + return $this->container['system_prompt']; + } + + /** + * Sets system_prompt + * + * @param string $system_prompt System prompt for the backing AI agent + * + * @return self + */ + public function setSystemPrompt($system_prompt) + { + if (is_null($system_prompt)) { + throw new \InvalidArgumentException('non-nullable system_prompt cannot be null'); + } + $this->container['system_prompt'] = $system_prompt; + + return $this; + } + + /** + * Gets model_id + * + * @return string + */ + public function getModelId() + { + return $this->container['model_id']; + } + + /** + * Sets model_id + * + * @param string $model_id AI model identifier + * + * @return self + */ + public function setModelId($model_id) + { + if (is_null($model_id)) { + throw new \InvalidArgumentException('non-nullable model_id cannot be null'); + } + $this->container['model_id'] = $model_id; + + return $this; + } + + /** + * Gets temperature + * + * @return float|null + */ + public function getTemperature() + { + return $this->container['temperature']; + } + + /** + * Sets temperature + * + * @param float|null $temperature Sampling temperature + * + * @return self + */ + public function setTemperature($temperature) + { + if (is_null($temperature)) { + throw new \InvalidArgumentException('non-nullable temperature cannot be null'); + } + + if (($temperature > 2)) { + throw new \InvalidArgumentException('invalid value for $temperature when calling CreateSlackBotRequest., must be smaller than or equal to 2.'); + } + if (($temperature < 0)) { + throw new \InvalidArgumentException('invalid value for $temperature when calling CreateSlackBotRequest., must be bigger than or equal to 0.'); + } + + $this->container['temperature'] = $temperature; + + return $this; + } + + /** + * Gets max_tokens + * + * @return int|null + */ + public function getMaxTokens() + { + return $this->container['max_tokens']; + } + + /** + * Sets max_tokens + * + * @param int|null $max_tokens Maximum response tokens + * + * @return self + */ + public function setMaxTokens($max_tokens) + { + if (is_null($max_tokens)) { + throw new \InvalidArgumentException('non-nullable max_tokens cannot be null'); + } + + if (($max_tokens < 1)) { + throw new \InvalidArgumentException('invalid value for $max_tokens when calling CreateSlackBotRequest., must be bigger than or equal to 1.'); + } + + $this->container['max_tokens'] = $max_tokens; + + return $this; + } + + /** + * Gets allowed_tools + * + * @return string[]|null + */ + public function getAllowedTools() + { + return $this->container['allowed_tools']; + } + + /** + * Sets allowed_tools + * + * @param string[]|null $allowed_tools Tools the agent may use + * + * @return self + */ + public function setAllowedTools($allowed_tools) + { + if (is_null($allowed_tools)) { + throw new \InvalidArgumentException('non-nullable allowed_tools cannot be null'); + } + $this->container['allowed_tools'] = $allowed_tools; + + return $this; + } + + /** + * Gets assigned_skills + * + * @return string[]|null + */ + public function getAssignedSkills() + { + return $this->container['assigned_skills']; + } + + /** + * Sets assigned_skills + * + * @param string[]|null $assigned_skills Skills assigned to the agent + * + * @return self + */ + public function setAssignedSkills($assigned_skills) + { + if (is_null($assigned_skills)) { + throw new \InvalidArgumentException('non-nullable assigned_skills cannot be null'); + } + $this->container['assigned_skills'] = $assigned_skills; + + return $this; + } + + /** + * Gets allowed_collections + * + * @return string[]|null + */ + public function getAllowedCollections() + { + return $this->container['allowed_collections']; + } + + /** + * Sets allowed_collections + * + * @param string[]|null $allowed_collections Vector DB collections the agent may query + * + * @return self + */ + public function setAllowedCollections($allowed_collections) + { + if (is_null($allowed_collections)) { + throw new \InvalidArgumentException('non-nullable allowed_collections cannot be null'); + } + $this->container['allowed_collections'] = $allowed_collections; + + return $this; + } + + /** + * Gets allowed_sub_agents + * + * @return string[]|null + */ + public function getAllowedSubAgents() + { + return $this->container['allowed_sub_agents']; + } + + /** + * Sets allowed_sub_agents + * + * @param string[]|null $allowed_sub_agents Sub-agents the agent may call + * + * @return self + */ + public function setAllowedSubAgents($allowed_sub_agents) + { + if (is_null($allowed_sub_agents)) { + throw new \InvalidArgumentException('non-nullable allowed_sub_agents cannot be null'); + } + $this->container['allowed_sub_agents'] = $allowed_sub_agents; + + return $this; + } + + /** + * Gets guardrail_preset + * + * @return string|null + */ + public function getGuardrailPreset() + { + return $this->container['guardrail_preset']; + } + + /** + * Sets guardrail_preset + * + * @param string|null $guardrail_preset Guardrail preset name + * + * @return self + */ + public function setGuardrailPreset($guardrail_preset) + { + if (is_null($guardrail_preset)) { + throw new \InvalidArgumentException('non-nullable guardrail_preset cannot be null'); + } + $this->container['guardrail_preset'] = $guardrail_preset; + + return $this; + } + + /** + * Gets filter_policies + * + * @return string[]|null + */ + public function getFilterPolicies() + { + return $this->container['filter_policies']; + } + + /** + * Sets filter_policies + * + * @param string[]|null $filter_policies Content filter policies + * + * @return self + */ + public function setFilterPolicies($filter_policies) + { + if (is_null($filter_policies)) { + throw new \InvalidArgumentException('non-nullable filter_policies cannot be null'); + } + $this->container['filter_policies'] = $filter_policies; + + return $this; + } + + /** + * Gets long_context + * + * @return bool|null + */ + public function getLongContext() + { + return $this->container['long_context']; + } + + /** + * Sets long_context + * + * @param bool|null $long_context Enable long context mode + * + * @return self + */ + public function setLongContext($long_context) + { + if (is_null($long_context)) { + throw new \InvalidArgumentException('non-nullable long_context cannot be null'); + } + $this->container['long_context'] = $long_context; + + return $this; + } + + /** + * Gets session_ttl_days + * + * @return int|null + */ + public function getSessionTtlDays() + { + return $this->container['session_ttl_days']; + } + + /** + * Sets session_ttl_days + * + * @param int|null $session_ttl_days Session TTL in days + * + * @return self + */ + public function setSessionTtlDays($session_ttl_days) + { + if (is_null($session_ttl_days)) { + throw new \InvalidArgumentException('non-nullable session_ttl_days cannot be null'); + } + + if (($session_ttl_days > 90)) { + throw new \InvalidArgumentException('invalid value for $session_ttl_days when calling CreateSlackBotRequest., must be smaller than or equal to 90.'); + } + if (($session_ttl_days < 1)) { + throw new \InvalidArgumentException('invalid value for $session_ttl_days when calling CreateSlackBotRequest., must be bigger than or equal to 1.'); + } + + $this->container['session_ttl_days'] = $session_ttl_days; + + return $this; + } + + /** + * Gets allowed_channels + * + * @return string[]|null + */ + public function getAllowedChannels() + { + return $this->container['allowed_channels']; + } + + /** + * Sets allowed_channels + * + * @param string[]|null $allowed_channels Slack channel IDs the bot may respond in + * + * @return self + */ + public function setAllowedChannels($allowed_channels) + { + if (is_null($allowed_channels)) { + throw new \InvalidArgumentException('non-nullable allowed_channels cannot be null'); + } + $this->container['allowed_channels'] = $allowed_channels; + + return $this; + } + + /** + * Gets allowed_users + * + * @return string[]|null + */ + public function getAllowedUsers() + { + return $this->container['allowed_users']; + } + + /** + * Sets allowed_users + * + * @param string[]|null $allowed_users Slack user IDs allowed to interact with the bot + * + * @return self + */ + public function setAllowedUsers($allowed_users) + { + if (is_null($allowed_users)) { + throw new \InvalidArgumentException('non-nullable allowed_users cannot be null'); + } + $this->container['allowed_users'] = $allowed_users; + + return $this; + } + + /** + * Gets denied_users + * + * @return string[]|null + */ + public function getDeniedUsers() + { + return $this->container['denied_users']; + } + + /** + * Sets denied_users + * + * @param string[]|null $denied_users Slack user IDs denied from interacting with the bot + * + * @return self + */ + public function setDeniedUsers($denied_users) + { + if (is_null($denied_users)) { + throw new \InvalidArgumentException('non-nullable denied_users cannot be null'); + } + $this->container['denied_users'] = $denied_users; + + return $this; + } + + /** + * Gets allow_guests + * + * @return bool|null + */ + public function getAllowGuests() + { + return $this->container['allow_guests']; + } + + /** + * Sets allow_guests + * + * @param bool|null $allow_guests Whether guest users may interact with the bot + * + * @return self + */ + public function setAllowGuests($allow_guests) + { + if (is_null($allow_guests)) { + throw new \InvalidArgumentException('non-nullable allow_guests cannot be null'); + } + $this->container['allow_guests'] = $allow_guests; + + return $this; + } + + /** + * Gets home_tab_content + * + * @return string|null + */ + public function getHomeTabContent() + { + return $this->container['home_tab_content']; + } + + /** + * Sets home_tab_content + * + * @param string|null $home_tab_content Content shown on the bot's Home tab in Slack + * + * @return self + */ + public function setHomeTabContent($home_tab_content) + { + if (is_null($home_tab_content)) { + throw new \InvalidArgumentException('non-nullable home_tab_content cannot be null'); + } + $this->container['home_tab_content'] = $home_tab_content; + + return $this; + } + + /** + * Gets agent_access_control + * + * @return object|null + */ + public function getAgentAccessControl() + { + return $this->container['agent_access_control']; + } + + /** + * Sets agent_access_control + * + * @param object|null $agent_access_control Agent-level access control settings + * + * @return self + */ + public function setAgentAccessControl($agent_access_control) + { + if (is_null($agent_access_control)) { + throw new \InvalidArgumentException('non-nullable agent_access_control cannot be null'); + } + $this->container['agent_access_control'] = $agent_access_control; + + return $this; + } + + /** + * Gets keywords_enabled + * + * @return bool|null + */ + public function getKeywordsEnabled() + { + return $this->container['keywords_enabled']; + } + + /** + * Sets keywords_enabled + * + * @param bool|null $keywords_enabled Whether keyword triggers are enabled + * + * @return self + */ + public function setKeywordsEnabled($keywords_enabled) + { + if (is_null($keywords_enabled)) { + throw new \InvalidArgumentException('non-nullable keywords_enabled cannot be null'); + } + $this->container['keywords_enabled'] = $keywords_enabled; + + return $this; + } + + /** + * Gets keywords + * + * @return string[]|null + */ + public function getKeywords() + { + return $this->container['keywords']; + } + + /** + * Sets keywords + * + * @param string[]|null $keywords Keywords that trigger the bot + * + * @return self + */ + public function setKeywords($keywords) + { + if (is_null($keywords)) { + throw new \InvalidArgumentException('non-nullable keywords cannot be null'); + } + $this->container['keywords'] = $keywords; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/CreateTask201Response.php b/src/Model/CreateTask201Response.php index 5f99de20..3b322f5e 100644 --- a/src/Model/CreateTask201Response.php +++ b/src/Model/CreateTask201Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateTaskRequest.php b/src/Model/CreateTaskRequest.php index 07dc79b1..3d463073 100644 --- a/src/Model/CreateTaskRequest.php +++ b/src/Model/CreateTaskRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateVectorCollection201Response.php b/src/Model/CreateVectorCollection201Response.php index 9c2a56e1..e0988065 100644 --- a/src/Model/CreateVectorCollection201Response.php +++ b/src/Model/CreateVectorCollection201Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateVectorCollection201ResponseCollection.php b/src/Model/CreateVectorCollection201ResponseCollection.php index 5bd0ac90..a2d67d3e 100644 --- a/src/Model/CreateVectorCollection201ResponseCollection.php +++ b/src/Model/CreateVectorCollection201ResponseCollection.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/CreateVectorCollectionRequest.php b/src/Model/CreateVectorCollectionRequest.php index ce4b6a13..296766ac 100644 --- a/src/Model/CreateVectorCollectionRequest.php +++ b/src/Model/CreateVectorCollectionRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -298,6 +298,9 @@ public function listInvalidProperties() if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } + if ($this->container['embedding_model'] === null) { + $invalidProperties[] = "'embedding_model' can't be null"; + } return $invalidProperties; } @@ -370,7 +373,7 @@ public function setDescription($description) /** * Gets embedding_model * - * @return string|null + * @return string */ public function getEmbeddingModel() { @@ -380,7 +383,7 @@ public function getEmbeddingModel() /** * Sets embedding_model * - * @param string|null $embedding_model Embedding model to use (default: amazon.titan-embed-text-v2:0) + * @param string $embedding_model Embedding model to use. Supported: amazon.titan-embed-text-v2:0, cohere.embed-english-v3, cohere.embed-multilingual-v3 * * @return self */ diff --git a/src/Model/CreateVolumeRequest.php b/src/Model/CreateVolumeRequest.php index 0f4ee915..cc676bdc 100644 --- a/src/Model/CreateVolumeRequest.php +++ b/src/Model/CreateVolumeRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/Cron.php b/src/Model/Cron.php index 8f9d457d..dbbe0af4 100644 --- a/src/Model/Cron.php +++ b/src/Model/Cron.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -58,8 +58,11 @@ class Cron implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'name' => 'string', - 'schedule' => 'string', - 'command' => 'string' + 'description' => 'string', + 'schedule_expression' => 'string', + 'command' => 'string[]', + 'target_container_name' => 'string', + 'is_enabled' => 'bool' ]; /** @@ -71,8 +74,11 @@ class Cron implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'name' => null, - 'schedule' => null, - 'command' => null + 'description' => null, + 'schedule_expression' => null, + 'command' => null, + 'target_container_name' => null, + 'is_enabled' => null ]; /** @@ -82,8 +88,11 @@ class Cron implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'name' => false, - 'schedule' => false, - 'command' => false + 'description' => true, + 'schedule_expression' => false, + 'command' => false, + 'target_container_name' => true, + 'is_enabled' => false ]; /** @@ -173,8 +182,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'name' => 'name', - 'schedule' => 'schedule', - 'command' => 'command' + 'description' => 'description', + 'schedule_expression' => 'scheduleExpression', + 'command' => 'command', + 'target_container_name' => 'targetContainerName', + 'is_enabled' => 'isEnabled' ]; /** @@ -184,8 +196,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'name' => 'setName', - 'schedule' => 'setSchedule', - 'command' => 'setCommand' + 'description' => 'setDescription', + 'schedule_expression' => 'setScheduleExpression', + 'command' => 'setCommand', + 'target_container_name' => 'setTargetContainerName', + 'is_enabled' => 'setIsEnabled' ]; /** @@ -195,8 +210,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'name' => 'getName', - 'schedule' => 'getSchedule', - 'command' => 'getCommand' + 'description' => 'getDescription', + 'schedule_expression' => 'getScheduleExpression', + 'command' => 'getCommand', + 'target_container_name' => 'getTargetContainerName', + 'is_enabled' => 'getIsEnabled' ]; /** @@ -257,8 +275,11 @@ public function getModelName() public function __construct(?array $data = null) { $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('schedule', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('schedule_expression', $data ?? [], null); $this->setIfExists('command', $data ?? [], null); + $this->setIfExists('target_container_name', $data ?? [], null); + $this->setIfExists('is_enabled', $data ?? [], null); } /** @@ -331,37 +352,71 @@ public function setName($name) } /** - * Gets schedule + * Gets description * * @return string|null */ - public function getSchedule() + public function getDescription() { - return $this->container['schedule']; + return $this->container['description']; } /** - * Sets schedule + * Sets description * - * @param string|null $schedule schedule + * @param string|null $description description * * @return self */ - public function setSchedule($schedule) + public function setDescription($description) { - if (is_null($schedule)) { - throw new \InvalidArgumentException('non-nullable schedule cannot be null'); + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['schedule'] = $schedule; + $this->container['description'] = $description; return $this; } /** - * Gets command + * Gets schedule_expression * * @return string|null */ + public function getScheduleExpression() + { + return $this->container['schedule_expression']; + } + + /** + * Sets schedule_expression + * + * @param string|null $schedule_expression schedule_expression + * + * @return self + */ + public function setScheduleExpression($schedule_expression) + { + if (is_null($schedule_expression)) { + throw new \InvalidArgumentException('non-nullable schedule_expression cannot be null'); + } + $this->container['schedule_expression'] = $schedule_expression; + + return $this; + } + + /** + * Gets command + * + * @return string[]|null + */ public function getCommand() { return $this->container['command']; @@ -370,7 +425,7 @@ public function getCommand() /** * Sets command * - * @param string|null $command command + * @param string[]|null $command command * * @return self */ @@ -383,6 +438,67 @@ public function setCommand($command) return $this; } + + /** + * Gets target_container_name + * + * @return string|null + */ + public function getTargetContainerName() + { + return $this->container['target_container_name']; + } + + /** + * Sets target_container_name + * + * @param string|null $target_container_name target_container_name + * + * @return self + */ + public function setTargetContainerName($target_container_name) + { + if (is_null($target_container_name)) { + array_push($this->openAPINullablesSetToNull, 'target_container_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('target_container_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['target_container_name'] = $target_container_name; + + return $this; + } + + /** + * Gets is_enabled + * + * @return bool|null + */ + public function getIsEnabled() + { + return $this->container['is_enabled']; + } + + /** + * Sets is_enabled + * + * @param bool|null $is_enabled is_enabled + * + * @return self + */ + public function setIsEnabled($is_enabled) + { + if (is_null($is_enabled)) { + throw new \InvalidArgumentException('non-nullable is_enabled cannot be null'); + } + $this->container['is_enabled'] = $is_enabled; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/CronRun.php b/src/Model/CronRun.php index 90b76ef5..0c43349c 100644 --- a/src/Model/CronRun.php +++ b/src/Model/CronRun.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/DeleteAIAgent200Response.php b/src/Model/DeleteAIAgent200Response.php index 682da4e3..d657213d 100644 --- a/src/Model/DeleteAIAgent200Response.php +++ b/src/Model/DeleteAIAgent200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/DeleteAISession200Response.php b/src/Model/DeleteAISession200Response.php index 44b1d753..e048e1be 100644 --- a/src/Model/DeleteAISession200Response.php +++ b/src/Model/DeleteAISession200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/DeleteVectorCollection200Response.php b/src/Model/DeleteAgentOverlay200Response.php similarity index 96% rename from src/Model/DeleteVectorCollection200Response.php rename to src/Model/DeleteAgentOverlay200Response.php index 521c91be..a2c4c019 100644 --- a/src/Model/DeleteVectorCollection200Response.php +++ b/src/Model/DeleteAgentOverlay200Response.php @@ -1,6 +1,6 @@ */ -class DeleteVectorCollection200Response implements ModelInterface, ArrayAccess, \JsonSerializable +class DeleteAgentOverlay200Response implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class DeleteVectorCollection200Response implements ModelInterface, ArrayAccess, * * @var string */ - protected static $openAPIModelName = 'deleteVectorCollection_200_response'; + protected static $openAPIModelName = 'deleteAgentOverlay_200_response'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/src/Model/DeleteBackup200Response.php b/src/Model/DeleteBackup200Response.php index 582a3bb6..37c4e22a 100644 --- a/src/Model/DeleteBackup200Response.php +++ b/src/Model/DeleteBackup200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/DeleteCustomTool200Response.php b/src/Model/DeleteCustomTool200Response.php index 457b16f3..b525a5f7 100644 --- a/src/Model/DeleteCustomTool200Response.php +++ b/src/Model/DeleteCustomTool200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/DeleteFile200Response.php b/src/Model/DeleteFile200Response.php index 637cfe63..d73a633c 100644 --- a/src/Model/DeleteFile200Response.php +++ b/src/Model/DeleteFile200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/DeleteSkill200Response.php b/src/Model/DeleteSkill200Response.php new file mode 100644 index 00000000..7378d789 --- /dev/null +++ b/src/Model/DeleteSkill200Response.php @@ -0,0 +1,443 @@ + + */ +class DeleteSkill200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'deleteSkill_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'success' => 'bool', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'success' => false, + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('success', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success) + { + if (is_null($success)) { + throw new \InvalidArgumentException('non-nullable success cannot be null'); + } + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/DeleteSkillCollection200Response.php b/src/Model/DeleteSkillCollection200Response.php new file mode 100644 index 00000000..0067f08c --- /dev/null +++ b/src/Model/DeleteSkillCollection200Response.php @@ -0,0 +1,443 @@ + + */ +class DeleteSkillCollection200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'deleteSkillCollection_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'success' => 'bool', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'success' => false, + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('success', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success) + { + if (is_null($success)) { + throw new \InvalidArgumentException('non-nullable success cannot be null'); + } + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/DeleteSlackBot200Response.php b/src/Model/DeleteSlackBot200Response.php new file mode 100644 index 00000000..69bccde0 --- /dev/null +++ b/src/Model/DeleteSlackBot200Response.php @@ -0,0 +1,443 @@ + + */ +class DeleteSlackBot200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'deleteSlackBot_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'success' => 'bool', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'success' => false, + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('success', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success) + { + if (is_null($success)) { + throw new \InvalidArgumentException('non-nullable success cannot be null'); + } + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/DeleteTask200Response.php b/src/Model/DeleteTask200Response.php index cdd8cc97..d72ed9c1 100644 --- a/src/Model/DeleteTask200Response.php +++ b/src/Model/DeleteTask200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/DeleteTask409Response.php b/src/Model/DeleteTask409Response.php index dd8be625..32d7b87b 100644 --- a/src/Model/DeleteTask409Response.php +++ b/src/Model/DeleteTask409Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/DeleteVectorDocuments200Response.php b/src/Model/DeleteVectorDocuments200Response.php new file mode 100644 index 00000000..de34c12e --- /dev/null +++ b/src/Model/DeleteVectorDocuments200Response.php @@ -0,0 +1,477 @@ + + */ +class DeleteVectorDocuments200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'deleteVectorDocuments_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + 'collection_id' => 'string', + 'deleted_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + 'collection_id' => null, + 'deleted_count' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'message' => false, + 'collection_id' => false, + 'deleted_count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + 'collection_id' => 'collectionId', + 'deleted_count' => 'deletedCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + 'collection_id' => 'setCollectionId', + 'deleted_count' => 'setDeletedCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + 'collection_id' => 'getCollectionId', + 'deleted_count' => 'getDeletedCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('collection_id', $data ?? [], null); + $this->setIfExists('deleted_count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets collection_id + * + * @return string|null + */ + public function getCollectionId() + { + return $this->container['collection_id']; + } + + /** + * Sets collection_id + * + * @param string|null $collection_id collection_id + * + * @return self + */ + public function setCollectionId($collection_id) + { + if (is_null($collection_id)) { + throw new \InvalidArgumentException('non-nullable collection_id cannot be null'); + } + $this->container['collection_id'] = $collection_id; + + return $this; + } + + /** + * Gets deleted_count + * + * @return int|null + */ + public function getDeletedCount() + { + return $this->container['deleted_count']; + } + + /** + * Sets deleted_count + * + * @param int|null $deleted_count deleted_count + * + * @return self + */ + public function setDeletedCount($deleted_count) + { + if (is_null($deleted_count)) { + throw new \InvalidArgumentException('non-nullable deleted_count cannot be null'); + } + $this->container['deleted_count'] = $deleted_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/DeleteVectorDocumentsRequest.php b/src/Model/DeleteVectorDocumentsRequest.php new file mode 100644 index 00000000..9cb3e979 --- /dev/null +++ b/src/Model/DeleteVectorDocumentsRequest.php @@ -0,0 +1,511 @@ + + */ +class DeleteVectorDocumentsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'deleteVectorDocuments_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'purge_all' => 'bool', + 'document_ids' => 'string[]', + 'keys' => 'string[]', + 'metadata' => '\QuantClient\Model\DeleteVectorDocumentsRequestMetadata' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'purge_all' => null, + 'document_ids' => 'uuid', + 'keys' => null, + 'metadata' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'purge_all' => false, + 'document_ids' => false, + 'keys' => false, + 'metadata' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'purge_all' => 'purgeAll', + 'document_ids' => 'documentIds', + 'keys' => 'keys', + 'metadata' => 'metadata' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'purge_all' => 'setPurgeAll', + 'document_ids' => 'setDocumentIds', + 'keys' => 'setKeys', + 'metadata' => 'setMetadata' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'purge_all' => 'getPurgeAll', + 'document_ids' => 'getDocumentIds', + 'keys' => 'getKeys', + 'metadata' => 'getMetadata' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('purge_all', $data ?? [], null); + $this->setIfExists('document_ids', $data ?? [], null); + $this->setIfExists('keys', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets purge_all + * + * @return bool|null + */ + public function getPurgeAll() + { + return $this->container['purge_all']; + } + + /** + * Sets purge_all + * + * @param bool|null $purge_all Delete ALL documents in collection + * + * @return self + */ + public function setPurgeAll($purge_all) + { + if (is_null($purge_all)) { + throw new \InvalidArgumentException('non-nullable purge_all cannot be null'); + } + $this->container['purge_all'] = $purge_all; + + return $this; + } + + /** + * Gets document_ids + * + * @return string[]|null + */ + public function getDocumentIds() + { + return $this->container['document_ids']; + } + + /** + * Sets document_ids + * + * @param string[]|null $document_ids Delete specific documents by UUID + * + * @return self + */ + public function setDocumentIds($document_ids) + { + if (is_null($document_ids)) { + throw new \InvalidArgumentException('non-nullable document_ids cannot be null'); + } + $this->container['document_ids'] = $document_ids; + + return $this; + } + + /** + * Gets keys + * + * @return string[]|null + */ + public function getKeys() + { + return $this->container['keys']; + } + + /** + * Sets keys + * + * @param string[]|null $keys Delete documents by key + * + * @return self + */ + public function setKeys($keys) + { + if (is_null($keys)) { + throw new \InvalidArgumentException('non-nullable keys cannot be null'); + } + $this->container['keys'] = $keys; + + return $this; + } + + /** + * Gets metadata + * + * @return \QuantClient\Model\DeleteVectorDocumentsRequestMetadata|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param \QuantClient\Model\DeleteVectorDocumentsRequestMetadata|null $metadata metadata + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/DeleteVectorDocumentsRequestMetadata.php b/src/Model/DeleteVectorDocumentsRequestMetadata.php new file mode 100644 index 00000000..2bce5ab1 --- /dev/null +++ b/src/Model/DeleteVectorDocumentsRequestMetadata.php @@ -0,0 +1,443 @@ + + */ +class DeleteVectorDocumentsRequestMetadata implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'deleteVectorDocuments_request_metadata'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'field' => 'string', + 'values' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'field' => null, + 'values' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'field' => false, + 'values' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'field' => 'field', + 'values' => 'values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'field' => 'setField', + 'values' => 'setValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'field' => 'getField', + 'values' => 'getValues' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('field', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets field + * + * @return string|null + */ + public function getField() + { + return $this->container['field']; + } + + /** + * Sets field + * + * @param string|null $field Metadata field name (e.g., 'drupal_entity_id') + * + * @return self + */ + public function setField($field) + { + if (is_null($field)) { + throw new \InvalidArgumentException('non-nullable field cannot be null'); + } + $this->container['field'] = $field; + + return $this; + } + + /** + * Gets values + * + * @return string[]|null + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param string[]|null $values Values to match (OR logic) + * + * @return self + */ + public function setValues($values) + { + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); + } + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/DownloadBackup200Response.php b/src/Model/DownloadBackup200Response.php index b79c2002..ac5757bc 100644 --- a/src/Model/DownloadBackup200Response.php +++ b/src/Model/DownloadBackup200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/Embeddings200Response.php b/src/Model/Embeddings200Response.php index 7ff49232..c38605d9 100644 --- a/src/Model/Embeddings200Response.php +++ b/src/Model/Embeddings200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/Embeddings200ResponseEmbeddings.php b/src/Model/Embeddings200ResponseEmbeddings.php index 311b99c3..83bc514d 100644 --- a/src/Model/Embeddings200ResponseEmbeddings.php +++ b/src/Model/Embeddings200ResponseEmbeddings.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/Embeddings200ResponseUsage.php b/src/Model/Embeddings200ResponseUsage.php index 945059f2..ee82cae8 100644 --- a/src/Model/Embeddings200ResponseUsage.php +++ b/src/Model/Embeddings200ResponseUsage.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/EmbeddingsRequest.php b/src/Model/EmbeddingsRequest.php index 3a79f62b..32b67723 100644 --- a/src/Model/EmbeddingsRequest.php +++ b/src/Model/EmbeddingsRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/EmbeddingsRequestInput.php b/src/Model/EmbeddingsRequestInput.php index 38fd9951..42479b4a 100644 --- a/src/Model/EmbeddingsRequestInput.php +++ b/src/Model/EmbeddingsRequestInput.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/Environment.php b/src/Model/Environment.php index f771dedf..b3af72ab 100644 --- a/src/Model/Environment.php +++ b/src/Model/Environment.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/EnvironmentResponse.php b/src/Model/EnvironmentResponse.php index 9788e195..0f102f5e 100644 --- a/src/Model/EnvironmentResponse.php +++ b/src/Model/EnvironmentResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -74,7 +74,7 @@ class EnvironmentResponse implements ModelInterface, ArrayAccess, \JsonSerializa 'security_group' => 'object', 'subnet' => 'object', 'vpc' => 'object', - 'containers' => 'object[]', + 'container_names' => 'string[]', 'volumes' => '\QuantClient\Model\Volume[]', 'cron' => '\QuantClient\Model\Cron[]', 'alb_routing' => 'object', @@ -106,7 +106,7 @@ class EnvironmentResponse implements ModelInterface, ArrayAccess, \JsonSerializa 'security_group' => null, 'subnet' => null, 'vpc' => null, - 'containers' => null, + 'container_names' => null, 'volumes' => null, 'cron' => null, 'alb_routing' => null, @@ -136,7 +136,7 @@ class EnvironmentResponse implements ModelInterface, ArrayAccess, \JsonSerializa 'security_group' => false, 'subnet' => false, 'vpc' => false, - 'containers' => false, + 'container_names' => false, 'volumes' => false, 'cron' => false, 'alb_routing' => false, @@ -246,7 +246,7 @@ public function isNullableSetToNull(string $property): bool 'security_group' => 'securityGroup', 'subnet' => 'subnet', 'vpc' => 'vpc', - 'containers' => 'containers', + 'container_names' => 'containerNames', 'volumes' => 'volumes', 'cron' => 'cron', 'alb_routing' => 'albRouting', @@ -276,7 +276,7 @@ public function isNullableSetToNull(string $property): bool 'security_group' => 'setSecurityGroup', 'subnet' => 'setSubnet', 'vpc' => 'setVpc', - 'containers' => 'setContainers', + 'container_names' => 'setContainerNames', 'volumes' => 'setVolumes', 'cron' => 'setCron', 'alb_routing' => 'setAlbRouting', @@ -306,7 +306,7 @@ public function isNullableSetToNull(string $property): bool 'security_group' => 'getSecurityGroup', 'subnet' => 'getSubnet', 'vpc' => 'getVpc', - 'containers' => 'getContainers', + 'container_names' => 'getContainerNames', 'volumes' => 'getVolumes', 'cron' => 'getCron', 'alb_routing' => 'getAlbRouting', @@ -404,7 +404,7 @@ public function __construct(?array $data = null) $this->setIfExists('security_group', $data ?? [], null); $this->setIfExists('subnet', $data ?? [], null); $this->setIfExists('vpc', $data ?? [], null); - $this->setIfExists('containers', $data ?? [], null); + $this->setIfExists('container_names', $data ?? [], null); $this->setIfExists('volumes', $data ?? [], null); $this->setIfExists('cron', $data ?? [], null); $this->setIfExists('alb_routing', $data ?? [], null); @@ -675,7 +675,7 @@ public function getDeploymentStatus() /** * Sets deployment_status * - * @param string|null $deployment_status Current deployment status. FAILED indicates the most recent deployment did not complete successfully. + * @param string|null $deployment_status Current deployment status * * @return self */ @@ -712,7 +712,7 @@ public function getDeploymentFailureType() /** * Sets deployment_failure_type * - * @param string|null $deployment_failure_type Type of deployment failure when deploymentStatus is FAILED (e.g., 'ECS_DEPLOYMENT_CIRCUIT_BREAKER', 'IMAGE_PULL_ERROR') + * @param string|null $deployment_failure_type Type of deployment failure * * @return self */ @@ -746,7 +746,7 @@ public function getDeploymentFailureReason() /** * Sets deployment_failure_reason * - * @param string|null $deployment_failure_reason Human-readable explanation of why the deployment failed. Contains details such as wrong image architecture, missing image, or container startup errors. + * @param string|null $deployment_failure_reason Reason for deployment failure * * @return self */ @@ -930,28 +930,28 @@ public function setVpc($vpc) } /** - * Gets containers + * Gets container_names * - * @return object[]|null + * @return string[]|null */ - public function getContainers() + public function getContainerNames() { - return $this->container['containers']; + return $this->container['container_names']; } /** - * Sets containers + * Sets container_names * - * @param object[]|null $containers Container configurations + * @param string[]|null $container_names Container name list * * @return self */ - public function setContainers($containers) + public function setContainerNames($container_names) { - if (is_null($containers)) { - throw new \InvalidArgumentException('non-nullable containers cannot be null'); + if (is_null($container_names)) { + throw new \InvalidArgumentException('non-nullable container_names cannot be null'); } - $this->container['containers'] = $containers; + $this->container['container_names'] = $container_names; return $this; } diff --git a/src/Model/EnvironmentSummary.php b/src/Model/EnvironmentSummary.php index 8aaeeccb..197f54e6 100644 --- a/src/Model/EnvironmentSummary.php +++ b/src/Model/EnvironmentSummary.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ExtendAISession200Response.php b/src/Model/ExtendAISession200Response.php index 57d099f1..0fd43c9f 100644 --- a/src/Model/ExtendAISession200Response.php +++ b/src/Model/ExtendAISession200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ExtendAISessionRequest.php b/src/Model/ExtendAISessionRequest.php index 3d7efdaa..9e6a3372 100644 --- a/src/Model/ExtendAISessionRequest.php +++ b/src/Model/ExtendAISessionRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetAIAgent200Response.php b/src/Model/GetAIAgent200Response.php index 79f45808..f138d326 100644 --- a/src/Model/GetAIAgent200Response.php +++ b/src/Model/GetAIAgent200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetAIAgent200ResponseAgent.php b/src/Model/GetAIAgent200ResponseAgent.php index 8fad5ffa..769ef54c 100644 --- a/src/Model/GetAIAgent200ResponseAgent.php +++ b/src/Model/GetAIAgent200ResponseAgent.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -67,6 +67,11 @@ class GetAIAgent200ResponseAgent implements ModelInterface, ArrayAccess, \JsonSe 'max_tokens' => 'int', 'allowed_tools' => 'string[]', 'allowed_collections' => 'string[]', + 'assigned_skills' => 'string[]', + 'long_context' => 'bool', + 'guardrail_preset' => 'string', + 'is_global' => 'bool', + 'has_overlay' => 'bool', 'created_by' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime' @@ -90,6 +95,11 @@ class GetAIAgent200ResponseAgent implements ModelInterface, ArrayAccess, \JsonSe 'max_tokens' => null, 'allowed_tools' => null, 'allowed_collections' => null, + 'assigned_skills' => null, + 'long_context' => null, + 'guardrail_preset' => null, + 'is_global' => null, + 'has_overlay' => null, 'created_by' => null, 'created_at' => 'date-time', 'updated_at' => 'date-time' @@ -111,6 +121,11 @@ class GetAIAgent200ResponseAgent implements ModelInterface, ArrayAccess, \JsonSe 'max_tokens' => false, 'allowed_tools' => false, 'allowed_collections' => false, + 'assigned_skills' => false, + 'long_context' => false, + 'guardrail_preset' => false, + 'is_global' => false, + 'has_overlay' => false, 'created_by' => false, 'created_at' => false, 'updated_at' => false @@ -212,6 +227,11 @@ public function isNullableSetToNull(string $property): bool 'max_tokens' => 'maxTokens', 'allowed_tools' => 'allowedTools', 'allowed_collections' => 'allowedCollections', + 'assigned_skills' => 'assignedSkills', + 'long_context' => 'longContext', + 'guardrail_preset' => 'guardrailPreset', + 'is_global' => 'isGlobal', + 'has_overlay' => 'hasOverlay', 'created_by' => 'createdBy', 'created_at' => 'createdAt', 'updated_at' => 'updatedAt' @@ -233,6 +253,11 @@ public function isNullableSetToNull(string $property): bool 'max_tokens' => 'setMaxTokens', 'allowed_tools' => 'setAllowedTools', 'allowed_collections' => 'setAllowedCollections', + 'assigned_skills' => 'setAssignedSkills', + 'long_context' => 'setLongContext', + 'guardrail_preset' => 'setGuardrailPreset', + 'is_global' => 'setIsGlobal', + 'has_overlay' => 'setHasOverlay', 'created_by' => 'setCreatedBy', 'created_at' => 'setCreatedAt', 'updated_at' => 'setUpdatedAt' @@ -254,6 +279,11 @@ public function isNullableSetToNull(string $property): bool 'max_tokens' => 'getMaxTokens', 'allowed_tools' => 'getAllowedTools', 'allowed_collections' => 'getAllowedCollections', + 'assigned_skills' => 'getAssignedSkills', + 'long_context' => 'getLongContext', + 'guardrail_preset' => 'getGuardrailPreset', + 'is_global' => 'getIsGlobal', + 'has_overlay' => 'getHasOverlay', 'created_by' => 'getCreatedBy', 'created_at' => 'getCreatedAt', 'updated_at' => 'getUpdatedAt' @@ -326,6 +356,11 @@ public function __construct(?array $data = null) $this->setIfExists('max_tokens', $data ?? [], null); $this->setIfExists('allowed_tools', $data ?? [], null); $this->setIfExists('allowed_collections', $data ?? [], null); + $this->setIfExists('assigned_skills', $data ?? [], null); + $this->setIfExists('long_context', $data ?? [], null); + $this->setIfExists('guardrail_preset', $data ?? [], null); + $this->setIfExists('is_global', $data ?? [], null); + $this->setIfExists('has_overlay', $data ?? [], null); $this->setIfExists('created_by', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); @@ -643,6 +678,141 @@ public function setAllowedCollections($allowed_collections) return $this; } + /** + * Gets assigned_skills + * + * @return string[]|null + */ + public function getAssignedSkills() + { + return $this->container['assigned_skills']; + } + + /** + * Sets assigned_skills + * + * @param string[]|null $assigned_skills assigned_skills + * + * @return self + */ + public function setAssignedSkills($assigned_skills) + { + if (is_null($assigned_skills)) { + throw new \InvalidArgumentException('non-nullable assigned_skills cannot be null'); + } + $this->container['assigned_skills'] = $assigned_skills; + + return $this; + } + + /** + * Gets long_context + * + * @return bool|null + */ + public function getLongContext() + { + return $this->container['long_context']; + } + + /** + * Sets long_context + * + * @param bool|null $long_context Whether 1M context window is enabled + * + * @return self + */ + public function setLongContext($long_context) + { + if (is_null($long_context)) { + throw new \InvalidArgumentException('non-nullable long_context cannot be null'); + } + $this->container['long_context'] = $long_context; + + return $this; + } + + /** + * Gets guardrail_preset + * + * @return string|null + */ + public function getGuardrailPreset() + { + return $this->container['guardrail_preset']; + } + + /** + * Sets guardrail_preset + * + * @param string|null $guardrail_preset Guardrail preset name + * + * @return self + */ + public function setGuardrailPreset($guardrail_preset) + { + if (is_null($guardrail_preset)) { + throw new \InvalidArgumentException('non-nullable guardrail_preset cannot be null'); + } + $this->container['guardrail_preset'] = $guardrail_preset; + + return $this; + } + + /** + * Gets is_global + * + * @return bool|null + */ + public function getIsGlobal() + { + return $this->container['is_global']; + } + + /** + * Sets is_global + * + * @param bool|null $is_global Whether this is a platform-managed global agent + * + * @return self + */ + public function setIsGlobal($is_global) + { + if (is_null($is_global)) { + throw new \InvalidArgumentException('non-nullable is_global cannot be null'); + } + $this->container['is_global'] = $is_global; + + return $this; + } + + /** + * Gets has_overlay + * + * @return bool|null + */ + public function getHasOverlay() + { + return $this->container['has_overlay']; + } + + /** + * Sets has_overlay + * + * @param bool|null $has_overlay Whether the requesting org has a per-org overlay for this global agent + * + * @return self + */ + public function setHasOverlay($has_overlay) + { + if (is_null($has_overlay)) { + throw new \InvalidArgumentException('non-nullable has_overlay cannot be null'); + } + $this->container['has_overlay'] = $has_overlay; + + return $this; + } + /** * Gets created_by * diff --git a/src/Model/GetAIModel200Response.php b/src/Model/GetAIModel200Response.php index 8d3060d5..355c2618 100644 --- a/src/Model/GetAIModel200Response.php +++ b/src/Model/GetAIModel200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetAIModel200ResponseCapabilities.php b/src/Model/GetAIModel200ResponseCapabilities.php index b3fa7d88..06bf0d80 100644 --- a/src/Model/GetAIModel200ResponseCapabilities.php +++ b/src/Model/GetAIModel200ResponseCapabilities.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetAIModel200ResponsePricing.php b/src/Model/GetAIModel200ResponsePricing.php index f65166d8..d5b5a736 100644 --- a/src/Model/GetAIModel200ResponsePricing.php +++ b/src/Model/GetAIModel200ResponsePricing.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetAIModel404Response.php b/src/Model/GetAIModel404Response.php index fa07c853..0f5ef815 100644 --- a/src/Model/GetAIModel404Response.php +++ b/src/Model/GetAIModel404Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetAIOrchestrationStatus200Response.php b/src/Model/GetAIOrchestrationStatus200Response.php index 8acbc433..84b9b6c6 100644 --- a/src/Model/GetAIOrchestrationStatus200Response.php +++ b/src/Model/GetAIOrchestrationStatus200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -61,11 +61,12 @@ class GetAIOrchestrationStatus200Response implements ModelInterface, ArrayAccess 'status' => 'string', 'tool_count' => 'int', 'completed_tools' => 'int', - 'synthesized_response' => 'string', + 'result' => 'string', 'tools' => '\QuantClient\Model\GetAIOrchestrationStatus200ResponseToolsInner[]', 'error' => 'string', 'created_at' => '\DateTime', - 'completed_at' => '\DateTime' + 'completed_at' => '\DateTime', + 'duration' => 'int' ]; /** @@ -80,11 +81,12 @@ class GetAIOrchestrationStatus200Response implements ModelInterface, ArrayAccess 'status' => null, 'tool_count' => null, 'completed_tools' => null, - 'synthesized_response' => null, + 'result' => null, 'tools' => null, 'error' => null, 'created_at' => 'date-time', - 'completed_at' => 'date-time' + 'completed_at' => 'date-time', + 'duration' => null ]; /** @@ -97,11 +99,12 @@ class GetAIOrchestrationStatus200Response implements ModelInterface, ArrayAccess 'status' => false, 'tool_count' => false, 'completed_tools' => false, - 'synthesized_response' => false, + 'result' => false, 'tools' => false, 'error' => false, 'created_at' => false, - 'completed_at' => false + 'completed_at' => false, + 'duration' => false ]; /** @@ -194,11 +197,12 @@ public function isNullableSetToNull(string $property): bool 'status' => 'status', 'tool_count' => 'toolCount', 'completed_tools' => 'completedTools', - 'synthesized_response' => 'synthesizedResponse', + 'result' => 'result', 'tools' => 'tools', 'error' => 'error', 'created_at' => 'createdAt', - 'completed_at' => 'completedAt' + 'completed_at' => 'completedAt', + 'duration' => 'duration' ]; /** @@ -211,11 +215,12 @@ public function isNullableSetToNull(string $property): bool 'status' => 'setStatus', 'tool_count' => 'setToolCount', 'completed_tools' => 'setCompletedTools', - 'synthesized_response' => 'setSynthesizedResponse', + 'result' => 'setResult', 'tools' => 'setTools', 'error' => 'setError', 'created_at' => 'setCreatedAt', - 'completed_at' => 'setCompletedAt' + 'completed_at' => 'setCompletedAt', + 'duration' => 'setDuration' ]; /** @@ -228,11 +233,12 @@ public function isNullableSetToNull(string $property): bool 'status' => 'getStatus', 'tool_count' => 'getToolCount', 'completed_tools' => 'getCompletedTools', - 'synthesized_response' => 'getSynthesizedResponse', + 'result' => 'getResult', 'tools' => 'getTools', 'error' => 'getError', 'created_at' => 'getCreatedAt', - 'completed_at' => 'getCompletedAt' + 'completed_at' => 'getCompletedAt', + 'duration' => 'getDuration' ]; /** @@ -277,7 +283,7 @@ public function getModelName() } public const STATUS_PENDING = 'pending'; - public const STATUS_POLLING = 'polling'; + public const STATUS_WAITING_TOOLS = 'waiting_tools'; public const STATUS_SYNTHESIZING = 'synthesizing'; public const STATUS_COMPLETE = 'complete'; public const STATUS_FAILED = 'failed'; @@ -291,7 +297,7 @@ public function getStatusAllowableValues() { return [ self::STATUS_PENDING, - self::STATUS_POLLING, + self::STATUS_WAITING_TOOLS, self::STATUS_SYNTHESIZING, self::STATUS_COMPLETE, self::STATUS_FAILED, @@ -317,11 +323,12 @@ public function __construct(?array $data = null) $this->setIfExists('status', $data ?? [], null); $this->setIfExists('tool_count', $data ?? [], null); $this->setIfExists('completed_tools', $data ?? [], null); - $this->setIfExists('synthesized_response', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); $this->setIfExists('tools', $data ?? [], null); $this->setIfExists('error', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('completed_at', $data ?? [], null); + $this->setIfExists('duration', $data ?? [], null); } /** @@ -506,28 +513,28 @@ public function setCompletedTools($completed_tools) } /** - * Gets synthesized_response + * Gets result * * @return string|null */ - public function getSynthesizedResponse() + public function getResult() { - return $this->container['synthesized_response']; + return $this->container['result']; } /** - * Sets synthesized_response + * Sets result * - * @param string|null $synthesized_response AI-synthesized response combining all tool results (only present when status=complete) + * @param string|null $result AI-synthesized response combining all tool results (only present when status=complete) * * @return self */ - public function setSynthesizedResponse($synthesized_response) + public function setResult($result) { - if (is_null($synthesized_response)) { - throw new \InvalidArgumentException('non-nullable synthesized_response cannot be null'); + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); } - $this->container['synthesized_response'] = $synthesized_response; + $this->container['result'] = $result; return $this; } @@ -639,6 +646,33 @@ public function setCompletedAt($completed_at) return $this; } + + /** + * Gets duration + * + * @return int|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param int|null $duration Seconds from creation to completion (present only once completed) + * + * @return self + */ + public function setDuration($duration) + { + if (is_null($duration)) { + throw new \InvalidArgumentException('non-nullable duration cannot be null'); + } + $this->container['duration'] = $duration; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/GetAIOrchestrationStatus200ResponseToolsInner.php b/src/Model/GetAIOrchestrationStatus200ResponseToolsInner.php index efa9234c..a69346a8 100644 --- a/src/Model/GetAIOrchestrationStatus200ResponseToolsInner.php +++ b/src/Model/GetAIOrchestrationStatus200ResponseToolsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetAIOrchestrationStatus404Response.php b/src/Model/GetAIOrchestrationStatus404Response.php index 6c2736d3..c252a1bd 100644 --- a/src/Model/GetAIOrchestrationStatus404Response.php +++ b/src/Model/GetAIOrchestrationStatus404Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetAISession200Response.php b/src/Model/GetAISession200Response.php index b1c178d6..a51ffe39 100644 --- a/src/Model/GetAISession200Response.php +++ b/src/Model/GetAISession200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetAIToolExecutionStatus200Response.php b/src/Model/GetAIToolExecutionStatus200Response.php index 180af548..4169544b 100644 --- a/src/Model/GetAIToolExecutionStatus200Response.php +++ b/src/Model/GetAIToolExecutionStatus200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetAIToolExecutionStatus200ResponseResult.php b/src/Model/GetAIToolExecutionStatus200ResponseResult.php index 392788ec..a155cac6 100644 --- a/src/Model/GetAIToolExecutionStatus200ResponseResult.php +++ b/src/Model/GetAIToolExecutionStatus200ResponseResult.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetAIToolExecutionStatus404Response.php b/src/Model/GetAIToolExecutionStatus404Response.php index b7f75214..9969ed27 100644 --- a/src/Model/GetAIToolExecutionStatus404Response.php +++ b/src/Model/GetAIToolExecutionStatus404Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetAgentOverlay200Response.php b/src/Model/GetAgentOverlay200Response.php new file mode 100644 index 00000000..cbc83ceb --- /dev/null +++ b/src/Model/GetAgentOverlay200Response.php @@ -0,0 +1,450 @@ + + */ +class GetAgentOverlay200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getAgentOverlay_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'overlay' => '\QuantClient\Model\GetAgentOverlay200ResponseOverlay', + 'base' => '\QuantClient\Model\GetAgentOverlay200ResponseBase' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'overlay' => null, + 'base' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'overlay' => true, + 'base' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'overlay' => 'overlay', + 'base' => 'base' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'overlay' => 'setOverlay', + 'base' => 'setBase' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'overlay' => 'getOverlay', + 'base' => 'getBase' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('overlay', $data ?? [], null); + $this->setIfExists('base', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets overlay + * + * @return \QuantClient\Model\GetAgentOverlay200ResponseOverlay|null + */ + public function getOverlay() + { + return $this->container['overlay']; + } + + /** + * Sets overlay + * + * @param \QuantClient\Model\GetAgentOverlay200ResponseOverlay|null $overlay overlay + * + * @return self + */ + public function setOverlay($overlay) + { + if (is_null($overlay)) { + array_push($this->openAPINullablesSetToNull, 'overlay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('overlay', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['overlay'] = $overlay; + + return $this; + } + + /** + * Gets base + * + * @return \QuantClient\Model\GetAgentOverlay200ResponseBase|null + */ + public function getBase() + { + return $this->container['base']; + } + + /** + * Sets base + * + * @param \QuantClient\Model\GetAgentOverlay200ResponseBase|null $base base + * + * @return self + */ + public function setBase($base) + { + if (is_null($base)) { + throw new \InvalidArgumentException('non-nullable base cannot be null'); + } + $this->container['base'] = $base; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetAgentOverlay200ResponseBase.php b/src/Model/GetAgentOverlay200ResponseBase.php new file mode 100644 index 00000000..6c80db4d --- /dev/null +++ b/src/Model/GetAgentOverlay200ResponseBase.php @@ -0,0 +1,546 @@ + + */ +class GetAgentOverlay200ResponseBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getAgentOverlay_200_response_base'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'agent_id' => 'string', + 'name' => 'string', + 'model_id' => 'string', + 'allowed_tools' => 'string[]', + 'assigned_skill_ids' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'agent_id' => null, + 'name' => null, + 'model_id' => null, + 'allowed_tools' => null, + 'assigned_skill_ids' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'agent_id' => false, + 'name' => false, + 'model_id' => false, + 'allowed_tools' => false, + 'assigned_skill_ids' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'agent_id' => 'agentId', + 'name' => 'name', + 'model_id' => 'modelId', + 'allowed_tools' => 'allowedTools', + 'assigned_skill_ids' => 'assignedSkillIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'agent_id' => 'setAgentId', + 'name' => 'setName', + 'model_id' => 'setModelId', + 'allowed_tools' => 'setAllowedTools', + 'assigned_skill_ids' => 'setAssignedSkillIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'agent_id' => 'getAgentId', + 'name' => 'getName', + 'model_id' => 'getModelId', + 'allowed_tools' => 'getAllowedTools', + 'assigned_skill_ids' => 'getAssignedSkillIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('agent_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('model_id', $data ?? [], null); + $this->setIfExists('allowed_tools', $data ?? [], null); + $this->setIfExists('assigned_skill_ids', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets agent_id + * + * @return string|null + */ + public function getAgentId() + { + return $this->container['agent_id']; + } + + /** + * Sets agent_id + * + * @param string|null $agent_id agent_id + * + * @return self + */ + public function setAgentId($agent_id) + { + if (is_null($agent_id)) { + throw new \InvalidArgumentException('non-nullable agent_id cannot be null'); + } + $this->container['agent_id'] = $agent_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets model_id + * + * @return string|null + */ + public function getModelId() + { + return $this->container['model_id']; + } + + /** + * Sets model_id + * + * @param string|null $model_id model_id + * + * @return self + */ + public function setModelId($model_id) + { + if (is_null($model_id)) { + throw new \InvalidArgumentException('non-nullable model_id cannot be null'); + } + $this->container['model_id'] = $model_id; + + return $this; + } + + /** + * Gets allowed_tools + * + * @return string[]|null + */ + public function getAllowedTools() + { + return $this->container['allowed_tools']; + } + + /** + * Sets allowed_tools + * + * @param string[]|null $allowed_tools allowed_tools + * + * @return self + */ + public function setAllowedTools($allowed_tools) + { + if (is_null($allowed_tools)) { + throw new \InvalidArgumentException('non-nullable allowed_tools cannot be null'); + } + $this->container['allowed_tools'] = $allowed_tools; + + return $this; + } + + /** + * Gets assigned_skill_ids + * + * @return string[]|null + */ + public function getAssignedSkillIds() + { + return $this->container['assigned_skill_ids']; + } + + /** + * Sets assigned_skill_ids + * + * @param string[]|null $assigned_skill_ids assigned_skill_ids + * + * @return self + */ + public function setAssignedSkillIds($assigned_skill_ids) + { + if (is_null($assigned_skill_ids)) { + throw new \InvalidArgumentException('non-nullable assigned_skill_ids cannot be null'); + } + $this->container['assigned_skill_ids'] = $assigned_skill_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetAgentOverlay200ResponseOverlay.php b/src/Model/GetAgentOverlay200ResponseOverlay.php new file mode 100644 index 00000000..e8a01154 --- /dev/null +++ b/src/Model/GetAgentOverlay200ResponseOverlay.php @@ -0,0 +1,749 @@ + + */ +class GetAgentOverlay200ResponseOverlay implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getAgentOverlay_200_response_overlay'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'model_id' => 'string', + 'temperature' => 'float', + 'max_tokens' => 'int', + 'disabled_skills' => 'string[]', + 'additional_skills' => 'string[]', + 'additional_tools' => 'string[]', + 'disabled_tools' => 'string[]', + 'system_prompt_append' => 'string', + 'allowed_collections' => 'string[]', + 'guardrail_preset' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'model_id' => null, + 'temperature' => null, + 'max_tokens' => null, + 'disabled_skills' => null, + 'additional_skills' => null, + 'additional_tools' => null, + 'disabled_tools' => null, + 'system_prompt_append' => null, + 'allowed_collections' => null, + 'guardrail_preset' => null, + 'version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'model_id' => false, + 'temperature' => false, + 'max_tokens' => false, + 'disabled_skills' => false, + 'additional_skills' => false, + 'additional_tools' => false, + 'disabled_tools' => false, + 'system_prompt_append' => false, + 'allowed_collections' => false, + 'guardrail_preset' => false, + 'version' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'model_id' => 'modelId', + 'temperature' => 'temperature', + 'max_tokens' => 'maxTokens', + 'disabled_skills' => 'disabledSkills', + 'additional_skills' => 'additionalSkills', + 'additional_tools' => 'additionalTools', + 'disabled_tools' => 'disabledTools', + 'system_prompt_append' => 'systemPromptAppend', + 'allowed_collections' => 'allowedCollections', + 'guardrail_preset' => 'guardrailPreset', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'model_id' => 'setModelId', + 'temperature' => 'setTemperature', + 'max_tokens' => 'setMaxTokens', + 'disabled_skills' => 'setDisabledSkills', + 'additional_skills' => 'setAdditionalSkills', + 'additional_tools' => 'setAdditionalTools', + 'disabled_tools' => 'setDisabledTools', + 'system_prompt_append' => 'setSystemPromptAppend', + 'allowed_collections' => 'setAllowedCollections', + 'guardrail_preset' => 'setGuardrailPreset', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'model_id' => 'getModelId', + 'temperature' => 'getTemperature', + 'max_tokens' => 'getMaxTokens', + 'disabled_skills' => 'getDisabledSkills', + 'additional_skills' => 'getAdditionalSkills', + 'additional_tools' => 'getAdditionalTools', + 'disabled_tools' => 'getDisabledTools', + 'system_prompt_append' => 'getSystemPromptAppend', + 'allowed_collections' => 'getAllowedCollections', + 'guardrail_preset' => 'getGuardrailPreset', + 'version' => 'getVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('model_id', $data ?? [], null); + $this->setIfExists('temperature', $data ?? [], null); + $this->setIfExists('max_tokens', $data ?? [], null); + $this->setIfExists('disabled_skills', $data ?? [], null); + $this->setIfExists('additional_skills', $data ?? [], null); + $this->setIfExists('additional_tools', $data ?? [], null); + $this->setIfExists('disabled_tools', $data ?? [], null); + $this->setIfExists('system_prompt_append', $data ?? [], null); + $this->setIfExists('allowed_collections', $data ?? [], null); + $this->setIfExists('guardrail_preset', $data ?? [], null); + $this->setIfExists('version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets model_id + * + * @return string|null + */ + public function getModelId() + { + return $this->container['model_id']; + } + + /** + * Sets model_id + * + * @param string|null $model_id model_id + * + * @return self + */ + public function setModelId($model_id) + { + if (is_null($model_id)) { + throw new \InvalidArgumentException('non-nullable model_id cannot be null'); + } + $this->container['model_id'] = $model_id; + + return $this; + } + + /** + * Gets temperature + * + * @return float|null + */ + public function getTemperature() + { + return $this->container['temperature']; + } + + /** + * Sets temperature + * + * @param float|null $temperature temperature + * + * @return self + */ + public function setTemperature($temperature) + { + if (is_null($temperature)) { + throw new \InvalidArgumentException('non-nullable temperature cannot be null'); + } + $this->container['temperature'] = $temperature; + + return $this; + } + + /** + * Gets max_tokens + * + * @return int|null + */ + public function getMaxTokens() + { + return $this->container['max_tokens']; + } + + /** + * Sets max_tokens + * + * @param int|null $max_tokens max_tokens + * + * @return self + */ + public function setMaxTokens($max_tokens) + { + if (is_null($max_tokens)) { + throw new \InvalidArgumentException('non-nullable max_tokens cannot be null'); + } + $this->container['max_tokens'] = $max_tokens; + + return $this; + } + + /** + * Gets disabled_skills + * + * @return string[]|null + */ + public function getDisabledSkills() + { + return $this->container['disabled_skills']; + } + + /** + * Sets disabled_skills + * + * @param string[]|null $disabled_skills disabled_skills + * + * @return self + */ + public function setDisabledSkills($disabled_skills) + { + if (is_null($disabled_skills)) { + throw new \InvalidArgumentException('non-nullable disabled_skills cannot be null'); + } + $this->container['disabled_skills'] = $disabled_skills; + + return $this; + } + + /** + * Gets additional_skills + * + * @return string[]|null + */ + public function getAdditionalSkills() + { + return $this->container['additional_skills']; + } + + /** + * Sets additional_skills + * + * @param string[]|null $additional_skills additional_skills + * + * @return self + */ + public function setAdditionalSkills($additional_skills) + { + if (is_null($additional_skills)) { + throw new \InvalidArgumentException('non-nullable additional_skills cannot be null'); + } + $this->container['additional_skills'] = $additional_skills; + + return $this; + } + + /** + * Gets additional_tools + * + * @return string[]|null + */ + public function getAdditionalTools() + { + return $this->container['additional_tools']; + } + + /** + * Sets additional_tools + * + * @param string[]|null $additional_tools additional_tools + * + * @return self + */ + public function setAdditionalTools($additional_tools) + { + if (is_null($additional_tools)) { + throw new \InvalidArgumentException('non-nullable additional_tools cannot be null'); + } + $this->container['additional_tools'] = $additional_tools; + + return $this; + } + + /** + * Gets disabled_tools + * + * @return string[]|null + */ + public function getDisabledTools() + { + return $this->container['disabled_tools']; + } + + /** + * Sets disabled_tools + * + * @param string[]|null $disabled_tools disabled_tools + * + * @return self + */ + public function setDisabledTools($disabled_tools) + { + if (is_null($disabled_tools)) { + throw new \InvalidArgumentException('non-nullable disabled_tools cannot be null'); + } + $this->container['disabled_tools'] = $disabled_tools; + + return $this; + } + + /** + * Gets system_prompt_append + * + * @return string|null + */ + public function getSystemPromptAppend() + { + return $this->container['system_prompt_append']; + } + + /** + * Sets system_prompt_append + * + * @param string|null $system_prompt_append system_prompt_append + * + * @return self + */ + public function setSystemPromptAppend($system_prompt_append) + { + if (is_null($system_prompt_append)) { + throw new \InvalidArgumentException('non-nullable system_prompt_append cannot be null'); + } + $this->container['system_prompt_append'] = $system_prompt_append; + + return $this; + } + + /** + * Gets allowed_collections + * + * @return string[]|null + */ + public function getAllowedCollections() + { + return $this->container['allowed_collections']; + } + + /** + * Sets allowed_collections + * + * @param string[]|null $allowed_collections allowed_collections + * + * @return self + */ + public function setAllowedCollections($allowed_collections) + { + if (is_null($allowed_collections)) { + throw new \InvalidArgumentException('non-nullable allowed_collections cannot be null'); + } + $this->container['allowed_collections'] = $allowed_collections; + + return $this; + } + + /** + * Gets guardrail_preset + * + * @return string|null + */ + public function getGuardrailPreset() + { + return $this->container['guardrail_preset']; + } + + /** + * Sets guardrail_preset + * + * @param string|null $guardrail_preset guardrail_preset + * + * @return self + */ + public function setGuardrailPreset($guardrail_preset) + { + if (is_null($guardrail_preset)) { + throw new \InvalidArgumentException('non-nullable guardrail_preset cannot be null'); + } + $this->container['guardrail_preset'] = $guardrail_preset; + + return $this; + } + + /** + * Gets version + * + * @return int|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int|null $version version + * + * @return self + */ + public function setVersion($version) + { + if (is_null($version)) { + throw new \InvalidArgumentException('non-nullable version cannot be null'); + } + $this->container['version'] = $version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetCustomTool200Response.php b/src/Model/GetCustomTool200Response.php new file mode 100644 index 00000000..ca4fb1cc --- /dev/null +++ b/src/Model/GetCustomTool200Response.php @@ -0,0 +1,409 @@ + + */ +class GetCustomTool200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getCustomTool_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'tool' => '\QuantClient\Model\GetCustomTool200ResponseTool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'tool' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tool' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tool' => 'tool' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tool' => 'setTool' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tool' => 'getTool' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('tool', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets tool + * + * @return \QuantClient\Model\GetCustomTool200ResponseTool|null + */ + public function getTool() + { + return $this->container['tool']; + } + + /** + * Sets tool + * + * @param \QuantClient\Model\GetCustomTool200ResponseTool|null $tool tool + * + * @return self + */ + public function setTool($tool) + { + if (is_null($tool)) { + throw new \InvalidArgumentException('non-nullable tool cannot be null'); + } + $this->container['tool'] = $tool; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetCustomTool200ResponseTool.php b/src/Model/GetCustomTool200ResponseTool.php new file mode 100644 index 00000000..0194b123 --- /dev/null +++ b/src/Model/GetCustomTool200ResponseTool.php @@ -0,0 +1,811 @@ + + */ +class GetCustomTool200ResponseTool implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getCustomTool_200_response_tool'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'description' => 'string', + 'edge_function_url' => 'string', + 'edge_function_code' => 'string', + 'is_async' => 'bool', + 'input_schema' => 'string', + 'output_schema' => 'string', + 'output_schema_description' => 'string', + 'category' => 'string', + 'response_mode' => 'string', + 'created_at' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'description' => null, + 'edge_function_url' => null, + 'edge_function_code' => null, + 'is_async' => null, + 'input_schema' => null, + 'output_schema' => null, + 'output_schema_description' => null, + 'category' => null, + 'response_mode' => null, + 'created_at' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'description' => false, + 'edge_function_url' => false, + 'edge_function_code' => false, + 'is_async' => false, + 'input_schema' => false, + 'output_schema' => true, + 'output_schema_description' => true, + 'category' => true, + 'response_mode' => true, + 'created_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'description' => 'description', + 'edge_function_url' => 'edgeFunctionUrl', + 'edge_function_code' => 'edgeFunctionCode', + 'is_async' => 'isAsync', + 'input_schema' => 'inputSchema', + 'output_schema' => 'outputSchema', + 'output_schema_description' => 'outputSchemaDescription', + 'category' => 'category', + 'response_mode' => 'responseMode', + 'created_at' => 'createdAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'edge_function_url' => 'setEdgeFunctionUrl', + 'edge_function_code' => 'setEdgeFunctionCode', + 'is_async' => 'setIsAsync', + 'input_schema' => 'setInputSchema', + 'output_schema' => 'setOutputSchema', + 'output_schema_description' => 'setOutputSchemaDescription', + 'category' => 'setCategory', + 'response_mode' => 'setResponseMode', + 'created_at' => 'setCreatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'edge_function_url' => 'getEdgeFunctionUrl', + 'edge_function_code' => 'getEdgeFunctionCode', + 'is_async' => 'getIsAsync', + 'input_schema' => 'getInputSchema', + 'output_schema' => 'getOutputSchema', + 'output_schema_description' => 'getOutputSchemaDescription', + 'category' => 'getCategory', + 'response_mode' => 'getResponseMode', + 'created_at' => 'getCreatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const RESPONSE_MODE_LLM = 'llm'; + public const RESPONSE_MODE_DIRECT = 'direct'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getResponseModeAllowableValues() + { + return [ + self::RESPONSE_MODE_LLM, + self::RESPONSE_MODE_DIRECT, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('edge_function_url', $data ?? [], null); + $this->setIfExists('edge_function_code', $data ?? [], null); + $this->setIfExists('is_async', $data ?? [], null); + $this->setIfExists('input_schema', $data ?? [], null); + $this->setIfExists('output_schema', $data ?? [], null); + $this->setIfExists('output_schema_description', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('response_mode', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getResponseModeAllowableValues(); + if (!is_null($this->container['response_mode']) && !in_array($this->container['response_mode'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'response_mode', must be one of '%s'", + $this->container['response_mode'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets edge_function_url + * + * @return string|null + */ + public function getEdgeFunctionUrl() + { + return $this->container['edge_function_url']; + } + + /** + * Sets edge_function_url + * + * @param string|null $edge_function_url edge_function_url + * + * @return self + */ + public function setEdgeFunctionUrl($edge_function_url) + { + if (is_null($edge_function_url)) { + throw new \InvalidArgumentException('non-nullable edge_function_url cannot be null'); + } + $this->container['edge_function_url'] = $edge_function_url; + + return $this; + } + + /** + * Gets edge_function_code + * + * @return string|null + */ + public function getEdgeFunctionCode() + { + return $this->container['edge_function_code']; + } + + /** + * Sets edge_function_code + * + * @param string|null $edge_function_code The deployed edge function source code + * + * @return self + */ + public function setEdgeFunctionCode($edge_function_code) + { + if (is_null($edge_function_code)) { + throw new \InvalidArgumentException('non-nullable edge_function_code cannot be null'); + } + $this->container['edge_function_code'] = $edge_function_code; + + return $this; + } + + /** + * Gets is_async + * + * @return bool|null + */ + public function getIsAsync() + { + return $this->container['is_async']; + } + + /** + * Sets is_async + * + * @param bool|null $is_async is_async + * + * @return self + */ + public function setIsAsync($is_async) + { + if (is_null($is_async)) { + throw new \InvalidArgumentException('non-nullable is_async cannot be null'); + } + $this->container['is_async'] = $is_async; + + return $this; + } + + /** + * Gets input_schema + * + * @return string|null + */ + public function getInputSchema() + { + return $this->container['input_schema']; + } + + /** + * Sets input_schema + * + * @param string|null $input_schema input_schema + * + * @return self + */ + public function setInputSchema($input_schema) + { + if (is_null($input_schema)) { + throw new \InvalidArgumentException('non-nullable input_schema cannot be null'); + } + $this->container['input_schema'] = $input_schema; + + return $this; + } + + /** + * Gets output_schema + * + * @return string|null + */ + public function getOutputSchema() + { + return $this->container['output_schema']; + } + + /** + * Sets output_schema + * + * @param string|null $output_schema output_schema + * + * @return self + */ + public function setOutputSchema($output_schema) + { + if (is_null($output_schema)) { + array_push($this->openAPINullablesSetToNull, 'output_schema'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('output_schema', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['output_schema'] = $output_schema; + + return $this; + } + + /** + * Gets output_schema_description + * + * @return string|null + */ + public function getOutputSchemaDescription() + { + return $this->container['output_schema_description']; + } + + /** + * Sets output_schema_description + * + * @param string|null $output_schema_description output_schema_description + * + * @return self + */ + public function setOutputSchemaDescription($output_schema_description) + { + if (is_null($output_schema_description)) { + array_push($this->openAPINullablesSetToNull, 'output_schema_description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('output_schema_description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['output_schema_description'] = $output_schema_description; + + return $this; + } + + /** + * Gets category + * + * @return string|null + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string|null $category category + * + * @return self + */ + public function setCategory($category) + { + if (is_null($category)) { + array_push($this->openAPINullablesSetToNull, 'category'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('category', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets response_mode + * + * @return string|null + */ + public function getResponseMode() + { + return $this->container['response_mode']; + } + + /** + * Sets response_mode + * + * @param string|null $response_mode response_mode + * + * @return self + */ + public function setResponseMode($response_mode) + { + if (is_null($response_mode)) { + array_push($this->openAPINullablesSetToNull, 'response_mode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('response_mode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $allowedValues = $this->getResponseModeAllowableValues(); + if (!is_null($response_mode) && !in_array($response_mode, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'response_mode', must be one of '%s'", + $response_mode, + implode("', '", $allowedValues) + ) + ); + } + $this->container['response_mode'] = $response_mode; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime|null $created_at created_at + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetDependencyGraph200Response.php b/src/Model/GetDependencyGraph200Response.php index 4bfcefa9..a40adb79 100644 --- a/src/Model/GetDependencyGraph200Response.php +++ b/src/Model/GetDependencyGraph200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetDurableExecutionStatus200Response.php b/src/Model/GetDurableExecutionStatus200Response.php index 4f0de200..e28649f5 100644 --- a/src/Model/GetDurableExecutionStatus200Response.php +++ b/src/Model/GetDurableExecutionStatus200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetDurableExecutionStatus200ResponseError.php b/src/Model/GetDurableExecutionStatus200ResponseError.php index 2e58ffa8..c01cb357 100644 --- a/src/Model/GetDurableExecutionStatus200ResponseError.php +++ b/src/Model/GetDurableExecutionStatus200ResponseError.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetDurableExecutionStatus200ResponsePendingToolsInner.php b/src/Model/GetDurableExecutionStatus200ResponsePendingToolsInner.php index ee4070b0..08e55c86 100644 --- a/src/Model/GetDurableExecutionStatus200ResponsePendingToolsInner.php +++ b/src/Model/GetDurableExecutionStatus200ResponsePendingToolsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetDurableExecutionStatus200ResponseResult.php b/src/Model/GetDurableExecutionStatus200ResponseResult.php index c71ee26d..a09c0d5f 100644 --- a/src/Model/GetDurableExecutionStatus200ResponseResult.php +++ b/src/Model/GetDurableExecutionStatus200ResponseResult.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetDurableExecutionStatus200ResponseResultResponse.php b/src/Model/GetDurableExecutionStatus200ResponseResultResponse.php index faa57e65..c34d1647 100644 --- a/src/Model/GetDurableExecutionStatus200ResponseResultResponse.php +++ b/src/Model/GetDurableExecutionStatus200ResponseResultResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetDurableExecutionStatus200ResponseResultUsage.php b/src/Model/GetDurableExecutionStatus200ResponseResultUsage.php index 13225b48..46e42b3c 100644 --- a/src/Model/GetDurableExecutionStatus200ResponseResultUsage.php +++ b/src/Model/GetDurableExecutionStatus200ResponseResultUsage.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -35,6 +35,7 @@ * GetDurableExecutionStatus200ResponseResultUsage Class Doc Comment * * @category Class + * @description Token usage and cost for the final synthesis turn * @package QuantClient * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -59,7 +60,8 @@ class GetDurableExecutionStatus200ResponseResultUsage implements ModelInterface, protected static $openAPITypes = [ 'input_tokens' => 'int', 'output_tokens' => 'int', - 'total_tokens' => 'int' + 'total_tokens' => 'int', + 'cost_cents' => 'float' ]; /** @@ -72,7 +74,8 @@ class GetDurableExecutionStatus200ResponseResultUsage implements ModelInterface, protected static $openAPIFormats = [ 'input_tokens' => null, 'output_tokens' => null, - 'total_tokens' => null + 'total_tokens' => null, + 'cost_cents' => 'float' ]; /** @@ -83,7 +86,8 @@ class GetDurableExecutionStatus200ResponseResultUsage implements ModelInterface, protected static array $openAPINullables = [ 'input_tokens' => false, 'output_tokens' => false, - 'total_tokens' => false + 'total_tokens' => false, + 'cost_cents' => false ]; /** @@ -174,7 +178,8 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'input_tokens' => 'inputTokens', 'output_tokens' => 'outputTokens', - 'total_tokens' => 'totalTokens' + 'total_tokens' => 'totalTokens', + 'cost_cents' => 'costCents' ]; /** @@ -185,7 +190,8 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'input_tokens' => 'setInputTokens', 'output_tokens' => 'setOutputTokens', - 'total_tokens' => 'setTotalTokens' + 'total_tokens' => 'setTotalTokens', + 'cost_cents' => 'setCostCents' ]; /** @@ -196,7 +202,8 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'input_tokens' => 'getInputTokens', 'output_tokens' => 'getOutputTokens', - 'total_tokens' => 'getTotalTokens' + 'total_tokens' => 'getTotalTokens', + 'cost_cents' => 'getCostCents' ]; /** @@ -259,6 +266,7 @@ public function __construct(?array $data = null) $this->setIfExists('input_tokens', $data ?? [], null); $this->setIfExists('output_tokens', $data ?? [], null); $this->setIfExists('total_tokens', $data ?? [], null); + $this->setIfExists('cost_cents', $data ?? [], null); } /** @@ -383,6 +391,33 @@ public function setTotalTokens($total_tokens) return $this; } + + /** + * Gets cost_cents + * + * @return float|null + */ + public function getCostCents() + { + return $this->container['cost_cents']; + } + + /** + * Sets cost_cents + * + * @param float|null $cost_cents Cost of the final synthesis turn in US cents + * + * @return self + */ + public function setCostCents($cost_cents) + { + if (is_null($cost_cents)) { + throw new \InvalidArgumentException('non-nullable cost_cents cannot be null'); + } + $this->container['cost_cents'] = $cost_cents; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/GetEcrLoginCredentials200Response.php b/src/Model/GetEcrLoginCredentials200Response.php index 861105e0..a2f97dc4 100644 --- a/src/Model/GetEcrLoginCredentials200Response.php +++ b/src/Model/GetEcrLoginCredentials200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetEnvironmentLogs200Response.php b/src/Model/GetEnvironmentLogs200Response.php index e0bdc34a..19acca5c 100644 --- a/src/Model/GetEnvironmentLogs200Response.php +++ b/src/Model/GetEnvironmentLogs200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetEnvironmentLogs200ResponseLogEventsInner.php b/src/Model/GetEnvironmentLogs200ResponseLogEventsInner.php index e4fa05a8..b4441521 100644 --- a/src/Model/GetEnvironmentLogs200ResponseLogEventsInner.php +++ b/src/Model/GetEnvironmentLogs200ResponseLogEventsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetFile200Response.php b/src/Model/GetFile200Response.php index eb8c41c9..b5071755 100644 --- a/src/Model/GetFile200Response.php +++ b/src/Model/GetFile200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetGovernanceConfig200Response.php b/src/Model/GetGovernanceConfig200Response.php new file mode 100644 index 00000000..607f1ed8 --- /dev/null +++ b/src/Model/GetGovernanceConfig200Response.php @@ -0,0 +1,690 @@ + + */ +class GetGovernanceConfig200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getGovernanceConfig_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'org_id' => 'string', + 'ai_enabled' => 'bool', + 'model_policy' => 'string', + 'model_list' => 'string[]', + 'mandatory_guardrail_preset' => 'string', + 'mandatory_filter_policies' => 'string[]', + 'spend_limits' => '\QuantClient\Model\GetGovernanceConfig200ResponseSpendLimits', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'org_id' => null, + 'ai_enabled' => null, + 'model_policy' => null, + 'model_list' => null, + 'mandatory_guardrail_preset' => null, + 'mandatory_filter_policies' => null, + 'spend_limits' => null, + 'version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'org_id' => false, + 'ai_enabled' => false, + 'model_policy' => false, + 'model_list' => false, + 'mandatory_guardrail_preset' => true, + 'mandatory_filter_policies' => false, + 'spend_limits' => false, + 'version' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'org_id' => 'orgId', + 'ai_enabled' => 'aiEnabled', + 'model_policy' => 'modelPolicy', + 'model_list' => 'modelList', + 'mandatory_guardrail_preset' => 'mandatoryGuardrailPreset', + 'mandatory_filter_policies' => 'mandatoryFilterPolicies', + 'spend_limits' => 'spendLimits', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'org_id' => 'setOrgId', + 'ai_enabled' => 'setAiEnabled', + 'model_policy' => 'setModelPolicy', + 'model_list' => 'setModelList', + 'mandatory_guardrail_preset' => 'setMandatoryGuardrailPreset', + 'mandatory_filter_policies' => 'setMandatoryFilterPolicies', + 'spend_limits' => 'setSpendLimits', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'org_id' => 'getOrgId', + 'ai_enabled' => 'getAiEnabled', + 'model_policy' => 'getModelPolicy', + 'model_list' => 'getModelList', + 'mandatory_guardrail_preset' => 'getMandatoryGuardrailPreset', + 'mandatory_filter_policies' => 'getMandatoryFilterPolicies', + 'spend_limits' => 'getSpendLimits', + 'version' => 'getVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const MODEL_POLICY_UNRESTRICTED = 'unrestricted'; + public const MODEL_POLICY_ALLOWLIST = 'allowlist'; + public const MODEL_POLICY_BLOCKLIST = 'blocklist'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getModelPolicyAllowableValues() + { + return [ + self::MODEL_POLICY_UNRESTRICTED, + self::MODEL_POLICY_ALLOWLIST, + self::MODEL_POLICY_BLOCKLIST, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('org_id', $data ?? [], null); + $this->setIfExists('ai_enabled', $data ?? [], null); + $this->setIfExists('model_policy', $data ?? [], null); + $this->setIfExists('model_list', $data ?? [], null); + $this->setIfExists('mandatory_guardrail_preset', $data ?? [], null); + $this->setIfExists('mandatory_filter_policies', $data ?? [], null); + $this->setIfExists('spend_limits', $data ?? [], null); + $this->setIfExists('version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getModelPolicyAllowableValues(); + if (!is_null($this->container['model_policy']) && !in_array($this->container['model_policy'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'model_policy', must be one of '%s'", + $this->container['model_policy'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets org_id + * + * @return string|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param string|null $org_id org_id + * + * @return self + */ + public function setOrgId($org_id) + { + if (is_null($org_id)) { + throw new \InvalidArgumentException('non-nullable org_id cannot be null'); + } + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets ai_enabled + * + * @return bool|null + */ + public function getAiEnabled() + { + return $this->container['ai_enabled']; + } + + /** + * Sets ai_enabled + * + * @param bool|null $ai_enabled ai_enabled + * + * @return self + */ + public function setAiEnabled($ai_enabled) + { + if (is_null($ai_enabled)) { + throw new \InvalidArgumentException('non-nullable ai_enabled cannot be null'); + } + $this->container['ai_enabled'] = $ai_enabled; + + return $this; + } + + /** + * Gets model_policy + * + * @return string|null + */ + public function getModelPolicy() + { + return $this->container['model_policy']; + } + + /** + * Sets model_policy + * + * @param string|null $model_policy model_policy + * + * @return self + */ + public function setModelPolicy($model_policy) + { + if (is_null($model_policy)) { + throw new \InvalidArgumentException('non-nullable model_policy cannot be null'); + } + $allowedValues = $this->getModelPolicyAllowableValues(); + if (!in_array($model_policy, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'model_policy', must be one of '%s'", + $model_policy, + implode("', '", $allowedValues) + ) + ); + } + $this->container['model_policy'] = $model_policy; + + return $this; + } + + /** + * Gets model_list + * + * @return string[]|null + */ + public function getModelList() + { + return $this->container['model_list']; + } + + /** + * Sets model_list + * + * @param string[]|null $model_list model_list + * + * @return self + */ + public function setModelList($model_list) + { + if (is_null($model_list)) { + throw new \InvalidArgumentException('non-nullable model_list cannot be null'); + } + $this->container['model_list'] = $model_list; + + return $this; + } + + /** + * Gets mandatory_guardrail_preset + * + * @return string|null + */ + public function getMandatoryGuardrailPreset() + { + return $this->container['mandatory_guardrail_preset']; + } + + /** + * Sets mandatory_guardrail_preset + * + * @param string|null $mandatory_guardrail_preset mandatory_guardrail_preset + * + * @return self + */ + public function setMandatoryGuardrailPreset($mandatory_guardrail_preset) + { + if (is_null($mandatory_guardrail_preset)) { + array_push($this->openAPINullablesSetToNull, 'mandatory_guardrail_preset'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mandatory_guardrail_preset', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mandatory_guardrail_preset'] = $mandatory_guardrail_preset; + + return $this; + } + + /** + * Gets mandatory_filter_policies + * + * @return string[]|null + */ + public function getMandatoryFilterPolicies() + { + return $this->container['mandatory_filter_policies']; + } + + /** + * Sets mandatory_filter_policies + * + * @param string[]|null $mandatory_filter_policies mandatory_filter_policies + * + * @return self + */ + public function setMandatoryFilterPolicies($mandatory_filter_policies) + { + if (is_null($mandatory_filter_policies)) { + throw new \InvalidArgumentException('non-nullable mandatory_filter_policies cannot be null'); + } + $this->container['mandatory_filter_policies'] = $mandatory_filter_policies; + + return $this; + } + + /** + * Gets spend_limits + * + * @return \QuantClient\Model\GetGovernanceConfig200ResponseSpendLimits|null + */ + public function getSpendLimits() + { + return $this->container['spend_limits']; + } + + /** + * Sets spend_limits + * + * @param \QuantClient\Model\GetGovernanceConfig200ResponseSpendLimits|null $spend_limits spend_limits + * + * @return self + */ + public function setSpendLimits($spend_limits) + { + if (is_null($spend_limits)) { + throw new \InvalidArgumentException('non-nullable spend_limits cannot be null'); + } + $this->container['spend_limits'] = $spend_limits; + + return $this; + } + + /** + * Gets version + * + * @return int|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int|null $version version + * + * @return self + */ + public function setVersion($version) + { + if (is_null($version)) { + throw new \InvalidArgumentException('non-nullable version cannot be null'); + } + $this->container['version'] = $version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetGovernanceConfig200ResponseSpendLimits.php b/src/Model/GetGovernanceConfig200ResponseSpendLimits.php new file mode 100644 index 00000000..4dd57b29 --- /dev/null +++ b/src/Model/GetGovernanceConfig200ResponseSpendLimits.php @@ -0,0 +1,764 @@ + + */ +class GetGovernanceConfig200ResponseSpendLimits implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getGovernanceConfig_200_response_spendLimits'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'monthly_budget_cents' => 'int', + 'daily_budget_cents' => 'int', + 'per_user_monthly_budget_cents' => 'int', + 'per_user_daily_budget_cents' => 'int', + 'warning_threshold_percent' => 'int', + 'interface_limits' => 'array', + 'user_overrides' => 'array', + 'per_token_monthly_budget_cents' => 'int', + 'per_token_daily_budget_cents' => 'int', + 'token_overrides' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'monthly_budget_cents' => null, + 'daily_budget_cents' => null, + 'per_user_monthly_budget_cents' => null, + 'per_user_daily_budget_cents' => null, + 'warning_threshold_percent' => null, + 'interface_limits' => null, + 'user_overrides' => null, + 'per_token_monthly_budget_cents' => null, + 'per_token_daily_budget_cents' => null, + 'token_overrides' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'monthly_budget_cents' => true, + 'daily_budget_cents' => true, + 'per_user_monthly_budget_cents' => true, + 'per_user_daily_budget_cents' => true, + 'warning_threshold_percent' => true, + 'interface_limits' => false, + 'user_overrides' => false, + 'per_token_monthly_budget_cents' => true, + 'per_token_daily_budget_cents' => true, + 'token_overrides' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'monthly_budget_cents' => 'monthlyBudgetCents', + 'daily_budget_cents' => 'dailyBudgetCents', + 'per_user_monthly_budget_cents' => 'perUserMonthlyBudgetCents', + 'per_user_daily_budget_cents' => 'perUserDailyBudgetCents', + 'warning_threshold_percent' => 'warningThresholdPercent', + 'interface_limits' => 'interfaceLimits', + 'user_overrides' => 'userOverrides', + 'per_token_monthly_budget_cents' => 'perTokenMonthlyBudgetCents', + 'per_token_daily_budget_cents' => 'perTokenDailyBudgetCents', + 'token_overrides' => 'tokenOverrides' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'monthly_budget_cents' => 'setMonthlyBudgetCents', + 'daily_budget_cents' => 'setDailyBudgetCents', + 'per_user_monthly_budget_cents' => 'setPerUserMonthlyBudgetCents', + 'per_user_daily_budget_cents' => 'setPerUserDailyBudgetCents', + 'warning_threshold_percent' => 'setWarningThresholdPercent', + 'interface_limits' => 'setInterfaceLimits', + 'user_overrides' => 'setUserOverrides', + 'per_token_monthly_budget_cents' => 'setPerTokenMonthlyBudgetCents', + 'per_token_daily_budget_cents' => 'setPerTokenDailyBudgetCents', + 'token_overrides' => 'setTokenOverrides' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'monthly_budget_cents' => 'getMonthlyBudgetCents', + 'daily_budget_cents' => 'getDailyBudgetCents', + 'per_user_monthly_budget_cents' => 'getPerUserMonthlyBudgetCents', + 'per_user_daily_budget_cents' => 'getPerUserDailyBudgetCents', + 'warning_threshold_percent' => 'getWarningThresholdPercent', + 'interface_limits' => 'getInterfaceLimits', + 'user_overrides' => 'getUserOverrides', + 'per_token_monthly_budget_cents' => 'getPerTokenMonthlyBudgetCents', + 'per_token_daily_budget_cents' => 'getPerTokenDailyBudgetCents', + 'token_overrides' => 'getTokenOverrides' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('monthly_budget_cents', $data ?? [], null); + $this->setIfExists('daily_budget_cents', $data ?? [], null); + $this->setIfExists('per_user_monthly_budget_cents', $data ?? [], null); + $this->setIfExists('per_user_daily_budget_cents', $data ?? [], null); + $this->setIfExists('warning_threshold_percent', $data ?? [], null); + $this->setIfExists('interface_limits', $data ?? [], null); + $this->setIfExists('user_overrides', $data ?? [], null); + $this->setIfExists('per_token_monthly_budget_cents', $data ?? [], null); + $this->setIfExists('per_token_daily_budget_cents', $data ?? [], null); + $this->setIfExists('token_overrides', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets monthly_budget_cents + * + * @return int|null + */ + public function getMonthlyBudgetCents() + { + return $this->container['monthly_budget_cents']; + } + + /** + * Sets monthly_budget_cents + * + * @param int|null $monthly_budget_cents monthly_budget_cents + * + * @return self + */ + public function setMonthlyBudgetCents($monthly_budget_cents) + { + if (is_null($monthly_budget_cents)) { + array_push($this->openAPINullablesSetToNull, 'monthly_budget_cents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('monthly_budget_cents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['monthly_budget_cents'] = $monthly_budget_cents; + + return $this; + } + + /** + * Gets daily_budget_cents + * + * @return int|null + */ + public function getDailyBudgetCents() + { + return $this->container['daily_budget_cents']; + } + + /** + * Sets daily_budget_cents + * + * @param int|null $daily_budget_cents daily_budget_cents + * + * @return self + */ + public function setDailyBudgetCents($daily_budget_cents) + { + if (is_null($daily_budget_cents)) { + array_push($this->openAPINullablesSetToNull, 'daily_budget_cents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('daily_budget_cents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['daily_budget_cents'] = $daily_budget_cents; + + return $this; + } + + /** + * Gets per_user_monthly_budget_cents + * + * @return int|null + */ + public function getPerUserMonthlyBudgetCents() + { + return $this->container['per_user_monthly_budget_cents']; + } + + /** + * Sets per_user_monthly_budget_cents + * + * @param int|null $per_user_monthly_budget_cents per_user_monthly_budget_cents + * + * @return self + */ + public function setPerUserMonthlyBudgetCents($per_user_monthly_budget_cents) + { + if (is_null($per_user_monthly_budget_cents)) { + array_push($this->openAPINullablesSetToNull, 'per_user_monthly_budget_cents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('per_user_monthly_budget_cents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['per_user_monthly_budget_cents'] = $per_user_monthly_budget_cents; + + return $this; + } + + /** + * Gets per_user_daily_budget_cents + * + * @return int|null + */ + public function getPerUserDailyBudgetCents() + { + return $this->container['per_user_daily_budget_cents']; + } + + /** + * Sets per_user_daily_budget_cents + * + * @param int|null $per_user_daily_budget_cents per_user_daily_budget_cents + * + * @return self + */ + public function setPerUserDailyBudgetCents($per_user_daily_budget_cents) + { + if (is_null($per_user_daily_budget_cents)) { + array_push($this->openAPINullablesSetToNull, 'per_user_daily_budget_cents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('per_user_daily_budget_cents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['per_user_daily_budget_cents'] = $per_user_daily_budget_cents; + + return $this; + } + + /** + * Gets warning_threshold_percent + * + * @return int|null + */ + public function getWarningThresholdPercent() + { + return $this->container['warning_threshold_percent']; + } + + /** + * Sets warning_threshold_percent + * + * @param int|null $warning_threshold_percent warning_threshold_percent + * + * @return self + */ + public function setWarningThresholdPercent($warning_threshold_percent) + { + if (is_null($warning_threshold_percent)) { + array_push($this->openAPINullablesSetToNull, 'warning_threshold_percent'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('warning_threshold_percent', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['warning_threshold_percent'] = $warning_threshold_percent; + + return $this; + } + + /** + * Gets interface_limits + * + * @return array|null + */ + public function getInterfaceLimits() + { + return $this->container['interface_limits']; + } + + /** + * Sets interface_limits + * + * @param array|null $interface_limits Aggregate spend caps per interface label (slack, autonomous, api-gateway, streaming, websocket). Keys are interface labels. + * + * @return self + */ + public function setInterfaceLimits($interface_limits) + { + if (is_null($interface_limits)) { + throw new \InvalidArgumentException('non-nullable interface_limits cannot be null'); + } + $this->container['interface_limits'] = $interface_limits; + + return $this; + } + + /** + * Gets user_overrides + * + * @return array|null + */ + public function getUserOverrides() + { + return $this->container['user_overrides']; + } + + /** + * Sets user_overrides + * + * @param array|null $user_overrides Per-user budget overrides keyed by userId (numeric portal id, slack-, or system:code-agent). Replaces the flat per-user budget for that user; unlimited=true exempts them. + * + * @return self + */ + public function setUserOverrides($user_overrides) + { + if (is_null($user_overrides)) { + throw new \InvalidArgumentException('non-nullable user_overrides cannot be null'); + } + $this->container['user_overrides'] = $user_overrides; + + return $this; + } + + /** + * Gets per_token_monthly_budget_cents + * + * @return int|null + */ + public function getPerTokenMonthlyBudgetCents() + { + return $this->container['per_token_monthly_budget_cents']; + } + + /** + * Sets per_token_monthly_budget_cents + * + * @param int|null $per_token_monthly_budget_cents Flat monthly cap in cents applied to every API token without a named override + * + * @return self + */ + public function setPerTokenMonthlyBudgetCents($per_token_monthly_budget_cents) + { + if (is_null($per_token_monthly_budget_cents)) { + array_push($this->openAPINullablesSetToNull, 'per_token_monthly_budget_cents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('per_token_monthly_budget_cents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['per_token_monthly_budget_cents'] = $per_token_monthly_budget_cents; + + return $this; + } + + /** + * Gets per_token_daily_budget_cents + * + * @return int|null + */ + public function getPerTokenDailyBudgetCents() + { + return $this->container['per_token_daily_budget_cents']; + } + + /** + * Sets per_token_daily_budget_cents + * + * @param int|null $per_token_daily_budget_cents Flat daily cap in cents applied to every API token without a named override + * + * @return self + */ + public function setPerTokenDailyBudgetCents($per_token_daily_budget_cents) + { + if (is_null($per_token_daily_budget_cents)) { + array_push($this->openAPINullablesSetToNull, 'per_token_daily_budget_cents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('per_token_daily_budget_cents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['per_token_daily_budget_cents'] = $per_token_daily_budget_cents; + + return $this; + } + + /** + * Gets token_overrides + * + * @return array|null + */ + public function getTokenOverrides() + { + return $this->container['token_overrides']; + } + + /** + * Sets token_overrides + * + * @param array|null $token_overrides Per-token budget overrides keyed by API token id. Replaces the flat per-token budget for that token; unlimited=true exempts it. + * + * @return self + */ + public function setTokenOverrides($token_overrides) + { + if (is_null($token_overrides)) { + throw new \InvalidArgumentException('non-nullable token_overrides cannot be null'); + } + $this->container['token_overrides'] = $token_overrides; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue.php b/src/Model/GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue.php new file mode 100644 index 00000000..2a5f331f --- /dev/null +++ b/src/Model/GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue.php @@ -0,0 +1,457 @@ + + */ +class GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getGovernanceConfig_200_response_spendLimits_interfaceLimits_value'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'daily_cents' => 'int', + 'monthly_cents' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'daily_cents' => null, + 'monthly_cents' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'daily_cents' => true, + 'monthly_cents' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'daily_cents' => 'dailyCents', + 'monthly_cents' => 'monthlyCents' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'daily_cents' => 'setDailyCents', + 'monthly_cents' => 'setMonthlyCents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'daily_cents' => 'getDailyCents', + 'monthly_cents' => 'getMonthlyCents' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('daily_cents', $data ?? [], null); + $this->setIfExists('monthly_cents', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets daily_cents + * + * @return int|null + */ + public function getDailyCents() + { + return $this->container['daily_cents']; + } + + /** + * Sets daily_cents + * + * @param int|null $daily_cents daily_cents + * + * @return self + */ + public function setDailyCents($daily_cents) + { + if (is_null($daily_cents)) { + array_push($this->openAPINullablesSetToNull, 'daily_cents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('daily_cents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['daily_cents'] = $daily_cents; + + return $this; + } + + /** + * Gets monthly_cents + * + * @return int|null + */ + public function getMonthlyCents() + { + return $this->container['monthly_cents']; + } + + /** + * Sets monthly_cents + * + * @param int|null $monthly_cents monthly_cents + * + * @return self + */ + public function setMonthlyCents($monthly_cents) + { + if (is_null($monthly_cents)) { + array_push($this->openAPINullablesSetToNull, 'monthly_cents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('monthly_cents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['monthly_cents'] = $monthly_cents; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue.php b/src/Model/GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue.php new file mode 100644 index 00000000..3f0f7eac --- /dev/null +++ b/src/Model/GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue.php @@ -0,0 +1,498 @@ + + */ +class GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getGovernanceConfig_200_response_spendLimits_userOverrides_value'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'daily_cents' => 'int', + 'monthly_cents' => 'int', + 'unlimited' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'daily_cents' => null, + 'monthly_cents' => null, + 'unlimited' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'daily_cents' => true, + 'monthly_cents' => true, + 'unlimited' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'daily_cents' => 'dailyCents', + 'monthly_cents' => 'monthlyCents', + 'unlimited' => 'unlimited' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'daily_cents' => 'setDailyCents', + 'monthly_cents' => 'setMonthlyCents', + 'unlimited' => 'setUnlimited' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'daily_cents' => 'getDailyCents', + 'monthly_cents' => 'getMonthlyCents', + 'unlimited' => 'getUnlimited' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('daily_cents', $data ?? [], null); + $this->setIfExists('monthly_cents', $data ?? [], null); + $this->setIfExists('unlimited', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets daily_cents + * + * @return int|null + */ + public function getDailyCents() + { + return $this->container['daily_cents']; + } + + /** + * Sets daily_cents + * + * @param int|null $daily_cents daily_cents + * + * @return self + */ + public function setDailyCents($daily_cents) + { + if (is_null($daily_cents)) { + array_push($this->openAPINullablesSetToNull, 'daily_cents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('daily_cents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['daily_cents'] = $daily_cents; + + return $this; + } + + /** + * Gets monthly_cents + * + * @return int|null + */ + public function getMonthlyCents() + { + return $this->container['monthly_cents']; + } + + /** + * Sets monthly_cents + * + * @param int|null $monthly_cents monthly_cents + * + * @return self + */ + public function setMonthlyCents($monthly_cents) + { + if (is_null($monthly_cents)) { + array_push($this->openAPINullablesSetToNull, 'monthly_cents'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('monthly_cents', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['monthly_cents'] = $monthly_cents; + + return $this; + } + + /** + * Gets unlimited + * + * @return bool|null + */ + public function getUnlimited() + { + return $this->container['unlimited']; + } + + /** + * Sets unlimited + * + * @param bool|null $unlimited unlimited + * + * @return self + */ + public function setUnlimited($unlimited) + { + if (is_null($unlimited)) { + array_push($this->openAPINullablesSetToNull, 'unlimited'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('unlimited', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['unlimited'] = $unlimited; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetGovernanceSpend200Response.php b/src/Model/GetGovernanceSpend200Response.php new file mode 100644 index 00000000..a8c485f1 --- /dev/null +++ b/src/Model/GetGovernanceSpend200Response.php @@ -0,0 +1,566 @@ + + */ +class GetGovernanceSpend200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getGovernanceSpend_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'org_total' => '\QuantClient\Model\GetGovernanceSpend200ResponseOrgTotal', + 'today_total' => '\QuantClient\Model\GetGovernanceSpend200ResponseTodayTotal', + 'budget' => '\QuantClient\Model\GetGovernanceSpend200ResponseBudget', + 'daily_budget' => '\QuantClient\Model\GetGovernanceSpend200ResponseDailyBudget', + 'user_total' => '\QuantClient\Model\GetGovernanceSpend200ResponseUserTotal' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'org_total' => null, + 'today_total' => null, + 'budget' => null, + 'daily_budget' => null, + 'user_total' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'org_total' => false, + 'today_total' => false, + 'budget' => true, + 'daily_budget' => true, + 'user_total' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'org_total' => 'orgTotal', + 'today_total' => 'todayTotal', + 'budget' => 'budget', + 'daily_budget' => 'dailyBudget', + 'user_total' => 'userTotal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'org_total' => 'setOrgTotal', + 'today_total' => 'setTodayTotal', + 'budget' => 'setBudget', + 'daily_budget' => 'setDailyBudget', + 'user_total' => 'setUserTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'org_total' => 'getOrgTotal', + 'today_total' => 'getTodayTotal', + 'budget' => 'getBudget', + 'daily_budget' => 'getDailyBudget', + 'user_total' => 'getUserTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('org_total', $data ?? [], null); + $this->setIfExists('today_total', $data ?? [], null); + $this->setIfExists('budget', $data ?? [], null); + $this->setIfExists('daily_budget', $data ?? [], null); + $this->setIfExists('user_total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets org_total + * + * @return \QuantClient\Model\GetGovernanceSpend200ResponseOrgTotal|null + */ + public function getOrgTotal() + { + return $this->container['org_total']; + } + + /** + * Sets org_total + * + * @param \QuantClient\Model\GetGovernanceSpend200ResponseOrgTotal|null $org_total org_total + * + * @return self + */ + public function setOrgTotal($org_total) + { + if (is_null($org_total)) { + throw new \InvalidArgumentException('non-nullable org_total cannot be null'); + } + $this->container['org_total'] = $org_total; + + return $this; + } + + /** + * Gets today_total + * + * @return \QuantClient\Model\GetGovernanceSpend200ResponseTodayTotal|null + */ + public function getTodayTotal() + { + return $this->container['today_total']; + } + + /** + * Sets today_total + * + * @param \QuantClient\Model\GetGovernanceSpend200ResponseTodayTotal|null $today_total today_total + * + * @return self + */ + public function setTodayTotal($today_total) + { + if (is_null($today_total)) { + throw new \InvalidArgumentException('non-nullable today_total cannot be null'); + } + $this->container['today_total'] = $today_total; + + return $this; + } + + /** + * Gets budget + * + * @return \QuantClient\Model\GetGovernanceSpend200ResponseBudget|null + */ + public function getBudget() + { + return $this->container['budget']; + } + + /** + * Sets budget + * + * @param \QuantClient\Model\GetGovernanceSpend200ResponseBudget|null $budget budget + * + * @return self + */ + public function setBudget($budget) + { + if (is_null($budget)) { + array_push($this->openAPINullablesSetToNull, 'budget'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('budget', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['budget'] = $budget; + + return $this; + } + + /** + * Gets daily_budget + * + * @return \QuantClient\Model\GetGovernanceSpend200ResponseDailyBudget|null + */ + public function getDailyBudget() + { + return $this->container['daily_budget']; + } + + /** + * Sets daily_budget + * + * @param \QuantClient\Model\GetGovernanceSpend200ResponseDailyBudget|null $daily_budget daily_budget + * + * @return self + */ + public function setDailyBudget($daily_budget) + { + if (is_null($daily_budget)) { + array_push($this->openAPINullablesSetToNull, 'daily_budget'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('daily_budget', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['daily_budget'] = $daily_budget; + + return $this; + } + + /** + * Gets user_total + * + * @return \QuantClient\Model\GetGovernanceSpend200ResponseUserTotal|null + */ + public function getUserTotal() + { + return $this->container['user_total']; + } + + /** + * Sets user_total + * + * @param \QuantClient\Model\GetGovernanceSpend200ResponseUserTotal|null $user_total user_total + * + * @return self + */ + public function setUserTotal($user_total) + { + if (is_null($user_total)) { + array_push($this->openAPINullablesSetToNull, 'user_total'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('user_total', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['user_total'] = $user_total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetGovernanceSpend200ResponseBudget.php b/src/Model/GetGovernanceSpend200ResponseBudget.php new file mode 100644 index 00000000..4d30ed3d --- /dev/null +++ b/src/Model/GetGovernanceSpend200ResponseBudget.php @@ -0,0 +1,477 @@ + + */ +class GetGovernanceSpend200ResponseBudget implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getGovernanceSpend_200_response_budget'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'monthly_budget_cents' => 'int', + 'used_percent' => 'float', + 'remaining_cents' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'monthly_budget_cents' => null, + 'used_percent' => 'float', + 'remaining_cents' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'monthly_budget_cents' => false, + 'used_percent' => false, + 'remaining_cents' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'monthly_budget_cents' => 'monthlyBudgetCents', + 'used_percent' => 'usedPercent', + 'remaining_cents' => 'remainingCents' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'monthly_budget_cents' => 'setMonthlyBudgetCents', + 'used_percent' => 'setUsedPercent', + 'remaining_cents' => 'setRemainingCents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'monthly_budget_cents' => 'getMonthlyBudgetCents', + 'used_percent' => 'getUsedPercent', + 'remaining_cents' => 'getRemainingCents' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('monthly_budget_cents', $data ?? [], null); + $this->setIfExists('used_percent', $data ?? [], null); + $this->setIfExists('remaining_cents', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets monthly_budget_cents + * + * @return int|null + */ + public function getMonthlyBudgetCents() + { + return $this->container['monthly_budget_cents']; + } + + /** + * Sets monthly_budget_cents + * + * @param int|null $monthly_budget_cents monthly_budget_cents + * + * @return self + */ + public function setMonthlyBudgetCents($monthly_budget_cents) + { + if (is_null($monthly_budget_cents)) { + throw new \InvalidArgumentException('non-nullable monthly_budget_cents cannot be null'); + } + $this->container['monthly_budget_cents'] = $monthly_budget_cents; + + return $this; + } + + /** + * Gets used_percent + * + * @return float|null + */ + public function getUsedPercent() + { + return $this->container['used_percent']; + } + + /** + * Sets used_percent + * + * @param float|null $used_percent used_percent + * + * @return self + */ + public function setUsedPercent($used_percent) + { + if (is_null($used_percent)) { + throw new \InvalidArgumentException('non-nullable used_percent cannot be null'); + } + $this->container['used_percent'] = $used_percent; + + return $this; + } + + /** + * Gets remaining_cents + * + * @return int|null + */ + public function getRemainingCents() + { + return $this->container['remaining_cents']; + } + + /** + * Sets remaining_cents + * + * @param int|null $remaining_cents remaining_cents + * + * @return self + */ + public function setRemainingCents($remaining_cents) + { + if (is_null($remaining_cents)) { + throw new \InvalidArgumentException('non-nullable remaining_cents cannot be null'); + } + $this->container['remaining_cents'] = $remaining_cents; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetGovernanceSpend200ResponseDailyBudget.php b/src/Model/GetGovernanceSpend200ResponseDailyBudget.php new file mode 100644 index 00000000..fde02b4d --- /dev/null +++ b/src/Model/GetGovernanceSpend200ResponseDailyBudget.php @@ -0,0 +1,477 @@ + + */ +class GetGovernanceSpend200ResponseDailyBudget implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getGovernanceSpend_200_response_dailyBudget'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'daily_budget_cents' => 'int', + 'used_percent' => 'float', + 'remaining_cents' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'daily_budget_cents' => null, + 'used_percent' => 'float', + 'remaining_cents' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'daily_budget_cents' => false, + 'used_percent' => false, + 'remaining_cents' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'daily_budget_cents' => 'dailyBudgetCents', + 'used_percent' => 'usedPercent', + 'remaining_cents' => 'remainingCents' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'daily_budget_cents' => 'setDailyBudgetCents', + 'used_percent' => 'setUsedPercent', + 'remaining_cents' => 'setRemainingCents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'daily_budget_cents' => 'getDailyBudgetCents', + 'used_percent' => 'getUsedPercent', + 'remaining_cents' => 'getRemainingCents' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('daily_budget_cents', $data ?? [], null); + $this->setIfExists('used_percent', $data ?? [], null); + $this->setIfExists('remaining_cents', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets daily_budget_cents + * + * @return int|null + */ + public function getDailyBudgetCents() + { + return $this->container['daily_budget_cents']; + } + + /** + * Sets daily_budget_cents + * + * @param int|null $daily_budget_cents daily_budget_cents + * + * @return self + */ + public function setDailyBudgetCents($daily_budget_cents) + { + if (is_null($daily_budget_cents)) { + throw new \InvalidArgumentException('non-nullable daily_budget_cents cannot be null'); + } + $this->container['daily_budget_cents'] = $daily_budget_cents; + + return $this; + } + + /** + * Gets used_percent + * + * @return float|null + */ + public function getUsedPercent() + { + return $this->container['used_percent']; + } + + /** + * Sets used_percent + * + * @param float|null $used_percent used_percent + * + * @return self + */ + public function setUsedPercent($used_percent) + { + if (is_null($used_percent)) { + throw new \InvalidArgumentException('non-nullable used_percent cannot be null'); + } + $this->container['used_percent'] = $used_percent; + + return $this; + } + + /** + * Gets remaining_cents + * + * @return int|null + */ + public function getRemainingCents() + { + return $this->container['remaining_cents']; + } + + /** + * Sets remaining_cents + * + * @param int|null $remaining_cents remaining_cents + * + * @return self + */ + public function setRemainingCents($remaining_cents) + { + if (is_null($remaining_cents)) { + throw new \InvalidArgumentException('non-nullable remaining_cents cannot be null'); + } + $this->container['remaining_cents'] = $remaining_cents; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetGovernanceSpend200ResponseOrgTotal.php b/src/Model/GetGovernanceSpend200ResponseOrgTotal.php new file mode 100644 index 00000000..67801148 --- /dev/null +++ b/src/Model/GetGovernanceSpend200ResponseOrgTotal.php @@ -0,0 +1,443 @@ + + */ +class GetGovernanceSpend200ResponseOrgTotal implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getGovernanceSpend_200_response_orgTotal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'spend_cents' => 'int', + 'request_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'spend_cents' => null, + 'request_count' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'spend_cents' => false, + 'request_count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'spend_cents' => 'spendCents', + 'request_count' => 'requestCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'spend_cents' => 'setSpendCents', + 'request_count' => 'setRequestCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'spend_cents' => 'getSpendCents', + 'request_count' => 'getRequestCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('spend_cents', $data ?? [], null); + $this->setIfExists('request_count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets spend_cents + * + * @return int|null + */ + public function getSpendCents() + { + return $this->container['spend_cents']; + } + + /** + * Sets spend_cents + * + * @param int|null $spend_cents Total org spend in US cents + * + * @return self + */ + public function setSpendCents($spend_cents) + { + if (is_null($spend_cents)) { + throw new \InvalidArgumentException('non-nullable spend_cents cannot be null'); + } + $this->container['spend_cents'] = $spend_cents; + + return $this; + } + + /** + * Gets request_count + * + * @return int|null + */ + public function getRequestCount() + { + return $this->container['request_count']; + } + + /** + * Sets request_count + * + * @param int|null $request_count request_count + * + * @return self + */ + public function setRequestCount($request_count) + { + if (is_null($request_count)) { + throw new \InvalidArgumentException('non-nullable request_count cannot be null'); + } + $this->container['request_count'] = $request_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetGovernanceSpend200ResponseTodayTotal.php b/src/Model/GetGovernanceSpend200ResponseTodayTotal.php new file mode 100644 index 00000000..0cc4308d --- /dev/null +++ b/src/Model/GetGovernanceSpend200ResponseTodayTotal.php @@ -0,0 +1,443 @@ + + */ +class GetGovernanceSpend200ResponseTodayTotal implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getGovernanceSpend_200_response_todayTotal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'spend_cents' => 'int', + 'request_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'spend_cents' => null, + 'request_count' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'spend_cents' => false, + 'request_count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'spend_cents' => 'spendCents', + 'request_count' => 'requestCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'spend_cents' => 'setSpendCents', + 'request_count' => 'setRequestCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'spend_cents' => 'getSpendCents', + 'request_count' => 'getRequestCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('spend_cents', $data ?? [], null); + $this->setIfExists('request_count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets spend_cents + * + * @return int|null + */ + public function getSpendCents() + { + return $this->container['spend_cents']; + } + + /** + * Sets spend_cents + * + * @param int|null $spend_cents Org spend today in US cents + * + * @return self + */ + public function setSpendCents($spend_cents) + { + if (is_null($spend_cents)) { + throw new \InvalidArgumentException('non-nullable spend_cents cannot be null'); + } + $this->container['spend_cents'] = $spend_cents; + + return $this; + } + + /** + * Gets request_count + * + * @return int|null + */ + public function getRequestCount() + { + return $this->container['request_count']; + } + + /** + * Sets request_count + * + * @param int|null $request_count request_count + * + * @return self + */ + public function setRequestCount($request_count) + { + if (is_null($request_count)) { + throw new \InvalidArgumentException('non-nullable request_count cannot be null'); + } + $this->container['request_count'] = $request_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetGovernanceSpend200ResponseUserTotal.php b/src/Model/GetGovernanceSpend200ResponseUserTotal.php new file mode 100644 index 00000000..9d1033d6 --- /dev/null +++ b/src/Model/GetGovernanceSpend200ResponseUserTotal.php @@ -0,0 +1,443 @@ + + */ +class GetGovernanceSpend200ResponseUserTotal implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getGovernanceSpend_200_response_userTotal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'monthly_spend_cents' => 'int', + 'daily_spend_cents' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'monthly_spend_cents' => null, + 'daily_spend_cents' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'monthly_spend_cents' => false, + 'daily_spend_cents' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'monthly_spend_cents' => 'monthlySpendCents', + 'daily_spend_cents' => 'dailySpendCents' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'monthly_spend_cents' => 'setMonthlySpendCents', + 'daily_spend_cents' => 'setDailySpendCents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'monthly_spend_cents' => 'getMonthlySpendCents', + 'daily_spend_cents' => 'getDailySpendCents' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('monthly_spend_cents', $data ?? [], null); + $this->setIfExists('daily_spend_cents', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets monthly_spend_cents + * + * @return int|null + */ + public function getMonthlySpendCents() + { + return $this->container['monthly_spend_cents']; + } + + /** + * Sets monthly_spend_cents + * + * @param int|null $monthly_spend_cents monthly_spend_cents + * + * @return self + */ + public function setMonthlySpendCents($monthly_spend_cents) + { + if (is_null($monthly_spend_cents)) { + throw new \InvalidArgumentException('non-nullable monthly_spend_cents cannot be null'); + } + $this->container['monthly_spend_cents'] = $monthly_spend_cents; + + return $this; + } + + /** + * Gets daily_spend_cents + * + * @return int|null + */ + public function getDailySpendCents() + { + return $this->container['daily_spend_cents']; + } + + /** + * Sets daily_spend_cents + * + * @param int|null $daily_spend_cents daily_spend_cents + * + * @return self + */ + public function setDailySpendCents($daily_spend_cents) + { + if (is_null($daily_spend_cents)) { + throw new \InvalidArgumentException('non-nullable daily_spend_cents cannot be null'); + } + $this->container['daily_spend_cents'] = $daily_spend_cents; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetMyUsage200Response.php b/src/Model/GetMyUsage200Response.php new file mode 100644 index 00000000..5b8e7751 --- /dev/null +++ b/src/Model/GetMyUsage200Response.php @@ -0,0 +1,552 @@ + + */ +class GetMyUsage200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getMyUsage_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'user_id' => 'string', + 'current_month' => 'string', + 'monthly' => '\QuantClient\Model\GetMyUsage200ResponseMonthly', + 'daily' => '\QuantClient\Model\GetMyUsage200ResponseDaily', + 'quota' => '\QuantClient\Model\GetMyUsage200ResponseQuota' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null, + 'current_month' => null, + 'monthly' => null, + 'daily' => null, + 'quota' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'user_id' => false, + 'current_month' => false, + 'monthly' => false, + 'daily' => false, + 'quota' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'userId', + 'current_month' => 'currentMonth', + 'monthly' => 'monthly', + 'daily' => 'daily', + 'quota' => 'quota' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'current_month' => 'setCurrentMonth', + 'monthly' => 'setMonthly', + 'daily' => 'setDaily', + 'quota' => 'setQuota' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'current_month' => 'getCurrentMonth', + 'monthly' => 'getMonthly', + 'daily' => 'getDaily', + 'quota' => 'getQuota' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('user_id', $data ?? [], null); + $this->setIfExists('current_month', $data ?? [], null); + $this->setIfExists('monthly', $data ?? [], null); + $this->setIfExists('daily', $data ?? [], null); + $this->setIfExists('quota', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return string|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param string|null $user_id user_id + * + * @return self + */ + public function setUserId($user_id) + { + if (is_null($user_id)) { + throw new \InvalidArgumentException('non-nullable user_id cannot be null'); + } + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets current_month + * + * @return string|null + */ + public function getCurrentMonth() + { + return $this->container['current_month']; + } + + /** + * Sets current_month + * + * @param string|null $current_month current_month + * + * @return self + */ + public function setCurrentMonth($current_month) + { + if (is_null($current_month)) { + throw new \InvalidArgumentException('non-nullable current_month cannot be null'); + } + $this->container['current_month'] = $current_month; + + return $this; + } + + /** + * Gets monthly + * + * @return \QuantClient\Model\GetMyUsage200ResponseMonthly|null + */ + public function getMonthly() + { + return $this->container['monthly']; + } + + /** + * Sets monthly + * + * @param \QuantClient\Model\GetMyUsage200ResponseMonthly|null $monthly monthly + * + * @return self + */ + public function setMonthly($monthly) + { + if (is_null($monthly)) { + throw new \InvalidArgumentException('non-nullable monthly cannot be null'); + } + $this->container['monthly'] = $monthly; + + return $this; + } + + /** + * Gets daily + * + * @return \QuantClient\Model\GetMyUsage200ResponseDaily|null + */ + public function getDaily() + { + return $this->container['daily']; + } + + /** + * Sets daily + * + * @param \QuantClient\Model\GetMyUsage200ResponseDaily|null $daily daily + * + * @return self + */ + public function setDaily($daily) + { + if (is_null($daily)) { + throw new \InvalidArgumentException('non-nullable daily cannot be null'); + } + $this->container['daily'] = $daily; + + return $this; + } + + /** + * Gets quota + * + * @return \QuantClient\Model\GetMyUsage200ResponseQuota|null + */ + public function getQuota() + { + return $this->container['quota']; + } + + /** + * Sets quota + * + * @param \QuantClient\Model\GetMyUsage200ResponseQuota|null $quota quota + * + * @return self + */ + public function setQuota($quota) + { + if (is_null($quota)) { + array_push($this->openAPINullablesSetToNull, 'quota'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('quota', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['quota'] = $quota; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetMyUsage200ResponseDaily.php b/src/Model/GetMyUsage200ResponseDaily.php new file mode 100644 index 00000000..7e0c76e8 --- /dev/null +++ b/src/Model/GetMyUsage200ResponseDaily.php @@ -0,0 +1,409 @@ + + */ +class GetMyUsage200ResponseDaily implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getMyUsage_200_response_daily'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'spend_cents' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'spend_cents' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'spend_cents' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'spend_cents' => 'spendCents' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'spend_cents' => 'setSpendCents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'spend_cents' => 'getSpendCents' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('spend_cents', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets spend_cents + * + * @return int|null + */ + public function getSpendCents() + { + return $this->container['spend_cents']; + } + + /** + * Sets spend_cents + * + * @param int|null $spend_cents spend_cents + * + * @return self + */ + public function setSpendCents($spend_cents) + { + if (is_null($spend_cents)) { + throw new \InvalidArgumentException('non-nullable spend_cents cannot be null'); + } + $this->container['spend_cents'] = $spend_cents; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetMyUsage200ResponseMonthly.php b/src/Model/GetMyUsage200ResponseMonthly.php new file mode 100644 index 00000000..5dea25b7 --- /dev/null +++ b/src/Model/GetMyUsage200ResponseMonthly.php @@ -0,0 +1,443 @@ + + */ +class GetMyUsage200ResponseMonthly implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getMyUsage_200_response_monthly'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'spend_cents' => 'int', + 'request_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'spend_cents' => null, + 'request_count' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'spend_cents' => false, + 'request_count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'spend_cents' => 'spendCents', + 'request_count' => 'requestCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'spend_cents' => 'setSpendCents', + 'request_count' => 'setRequestCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'spend_cents' => 'getSpendCents', + 'request_count' => 'getRequestCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('spend_cents', $data ?? [], null); + $this->setIfExists('request_count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets spend_cents + * + * @return int|null + */ + public function getSpendCents() + { + return $this->container['spend_cents']; + } + + /** + * Sets spend_cents + * + * @param int|null $spend_cents spend_cents + * + * @return self + */ + public function setSpendCents($spend_cents) + { + if (is_null($spend_cents)) { + throw new \InvalidArgumentException('non-nullable spend_cents cannot be null'); + } + $this->container['spend_cents'] = $spend_cents; + + return $this; + } + + /** + * Gets request_count + * + * @return int|null + */ + public function getRequestCount() + { + return $this->container['request_count']; + } + + /** + * Sets request_count + * + * @param int|null $request_count request_count + * + * @return self + */ + public function setRequestCount($request_count) + { + if (is_null($request_count)) { + throw new \InvalidArgumentException('non-nullable request_count cannot be null'); + } + $this->container['request_count'] = $request_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetMyUsage200ResponseQuota.php b/src/Model/GetMyUsage200ResponseQuota.php new file mode 100644 index 00000000..dd23b12b --- /dev/null +++ b/src/Model/GetMyUsage200ResponseQuota.php @@ -0,0 +1,457 @@ + + */ +class GetMyUsage200ResponseQuota implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getMyUsage_200_response_quota'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'monthly_limit' => '\QuantClient\Model\GetMyUsage200ResponseQuotaMonthlyLimit', + 'daily_limit' => '\QuantClient\Model\GetMyUsage200ResponseQuotaDailyLimit' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'monthly_limit' => null, + 'daily_limit' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'monthly_limit' => true, + 'daily_limit' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'monthly_limit' => 'monthlyLimit', + 'daily_limit' => 'dailyLimit' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'monthly_limit' => 'setMonthlyLimit', + 'daily_limit' => 'setDailyLimit' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'monthly_limit' => 'getMonthlyLimit', + 'daily_limit' => 'getDailyLimit' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('monthly_limit', $data ?? [], null); + $this->setIfExists('daily_limit', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets monthly_limit + * + * @return \QuantClient\Model\GetMyUsage200ResponseQuotaMonthlyLimit|null + */ + public function getMonthlyLimit() + { + return $this->container['monthly_limit']; + } + + /** + * Sets monthly_limit + * + * @param \QuantClient\Model\GetMyUsage200ResponseQuotaMonthlyLimit|null $monthly_limit monthly_limit + * + * @return self + */ + public function setMonthlyLimit($monthly_limit) + { + if (is_null($monthly_limit)) { + array_push($this->openAPINullablesSetToNull, 'monthly_limit'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('monthly_limit', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['monthly_limit'] = $monthly_limit; + + return $this; + } + + /** + * Gets daily_limit + * + * @return \QuantClient\Model\GetMyUsage200ResponseQuotaDailyLimit|null + */ + public function getDailyLimit() + { + return $this->container['daily_limit']; + } + + /** + * Sets daily_limit + * + * @param \QuantClient\Model\GetMyUsage200ResponseQuotaDailyLimit|null $daily_limit daily_limit + * + * @return self + */ + public function setDailyLimit($daily_limit) + { + if (is_null($daily_limit)) { + array_push($this->openAPINullablesSetToNull, 'daily_limit'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('daily_limit', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['daily_limit'] = $daily_limit; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetMyUsage200ResponseQuotaDailyLimit.php b/src/Model/GetMyUsage200ResponseQuotaDailyLimit.php new file mode 100644 index 00000000..ea5a878b --- /dev/null +++ b/src/Model/GetMyUsage200ResponseQuotaDailyLimit.php @@ -0,0 +1,512 @@ + + */ +class GetMyUsage200ResponseQuotaDailyLimit implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getMyUsage_200_response_quota_dailyLimit'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'limit_cents' => 'int', + 'used_percent' => 'float', + 'remaining_cents' => 'int', + 'resets_at' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'limit_cents' => null, + 'used_percent' => 'float', + 'remaining_cents' => null, + 'resets_at' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'limit_cents' => false, + 'used_percent' => false, + 'remaining_cents' => false, + 'resets_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'limit_cents' => 'limitCents', + 'used_percent' => 'usedPercent', + 'remaining_cents' => 'remainingCents', + 'resets_at' => 'resetsAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'limit_cents' => 'setLimitCents', + 'used_percent' => 'setUsedPercent', + 'remaining_cents' => 'setRemainingCents', + 'resets_at' => 'setResetsAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'limit_cents' => 'getLimitCents', + 'used_percent' => 'getUsedPercent', + 'remaining_cents' => 'getRemainingCents', + 'resets_at' => 'getResetsAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('limit_cents', $data ?? [], null); + $this->setIfExists('used_percent', $data ?? [], null); + $this->setIfExists('remaining_cents', $data ?? [], null); + $this->setIfExists('resets_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets limit_cents + * + * @return int|null + */ + public function getLimitCents() + { + return $this->container['limit_cents']; + } + + /** + * Sets limit_cents + * + * @param int|null $limit_cents The configured daily cap in US cents + * + * @return self + */ + public function setLimitCents($limit_cents) + { + if (is_null($limit_cents)) { + throw new \InvalidArgumentException('non-nullable limit_cents cannot be null'); + } + $this->container['limit_cents'] = $limit_cents; + + return $this; + } + + /** + * Gets used_percent + * + * @return float|null + */ + public function getUsedPercent() + { + return $this->container['used_percent']; + } + + /** + * Sets used_percent + * + * @param float|null $used_percent Percentage of the cap consumed today (0–100+) + * + * @return self + */ + public function setUsedPercent($used_percent) + { + if (is_null($used_percent)) { + throw new \InvalidArgumentException('non-nullable used_percent cannot be null'); + } + $this->container['used_percent'] = $used_percent; + + return $this; + } + + /** + * Gets remaining_cents + * + * @return int|null + */ + public function getRemainingCents() + { + return $this->container['remaining_cents']; + } + + /** + * Sets remaining_cents + * + * @param int|null $remaining_cents Cents remaining before the cap is hit; can be negative if overspent + * + * @return self + */ + public function setRemainingCents($remaining_cents) + { + if (is_null($remaining_cents)) { + throw new \InvalidArgumentException('non-nullable remaining_cents cannot be null'); + } + $this->container['remaining_cents'] = $remaining_cents; + + return $this; + } + + /** + * Gets resets_at + * + * @return \DateTime|null + */ + public function getResetsAt() + { + return $this->container['resets_at']; + } + + /** + * Sets resets_at + * + * @param \DateTime|null $resets_at UTC timestamp when the daily counter resets (always next UTC midnight) + * + * @return self + */ + public function setResetsAt($resets_at) + { + if (is_null($resets_at)) { + throw new \InvalidArgumentException('non-nullable resets_at cannot be null'); + } + $this->container['resets_at'] = $resets_at; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetMyUsage200ResponseQuotaMonthlyLimit.php b/src/Model/GetMyUsage200ResponseQuotaMonthlyLimit.php new file mode 100644 index 00000000..13f664e9 --- /dev/null +++ b/src/Model/GetMyUsage200ResponseQuotaMonthlyLimit.php @@ -0,0 +1,478 @@ + + */ +class GetMyUsage200ResponseQuotaMonthlyLimit implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getMyUsage_200_response_quota_monthlyLimit'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'limit_cents' => 'int', + 'used_percent' => 'float', + 'remaining_cents' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'limit_cents' => null, + 'used_percent' => 'float', + 'remaining_cents' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'limit_cents' => false, + 'used_percent' => false, + 'remaining_cents' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'limit_cents' => 'limitCents', + 'used_percent' => 'usedPercent', + 'remaining_cents' => 'remainingCents' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'limit_cents' => 'setLimitCents', + 'used_percent' => 'setUsedPercent', + 'remaining_cents' => 'setRemainingCents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'limit_cents' => 'getLimitCents', + 'used_percent' => 'getUsedPercent', + 'remaining_cents' => 'getRemainingCents' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('limit_cents', $data ?? [], null); + $this->setIfExists('used_percent', $data ?? [], null); + $this->setIfExists('remaining_cents', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets limit_cents + * + * @return int|null + */ + public function getLimitCents() + { + return $this->container['limit_cents']; + } + + /** + * Sets limit_cents + * + * @param int|null $limit_cents The configured monthly cap in US cents + * + * @return self + */ + public function setLimitCents($limit_cents) + { + if (is_null($limit_cents)) { + throw new \InvalidArgumentException('non-nullable limit_cents cannot be null'); + } + $this->container['limit_cents'] = $limit_cents; + + return $this; + } + + /** + * Gets used_percent + * + * @return float|null + */ + public function getUsedPercent() + { + return $this->container['used_percent']; + } + + /** + * Sets used_percent + * + * @param float|null $used_percent Percentage of the cap consumed this month (0–100+) + * + * @return self + */ + public function setUsedPercent($used_percent) + { + if (is_null($used_percent)) { + throw new \InvalidArgumentException('non-nullable used_percent cannot be null'); + } + $this->container['used_percent'] = $used_percent; + + return $this; + } + + /** + * Gets remaining_cents + * + * @return int|null + */ + public function getRemainingCents() + { + return $this->container['remaining_cents']; + } + + /** + * Sets remaining_cents + * + * @param int|null $remaining_cents Cents remaining before the cap is hit; can be negative if overspent + * + * @return self + */ + public function setRemainingCents($remaining_cents) + { + if (is_null($remaining_cents)) { + throw new \InvalidArgumentException('non-nullable remaining_cents cannot be null'); + } + $this->container['remaining_cents'] = $remaining_cents; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetRestoreStatus200Response.php b/src/Model/GetRestoreStatus200Response.php new file mode 100644 index 00000000..ba15a898 --- /dev/null +++ b/src/Model/GetRestoreStatus200Response.php @@ -0,0 +1,815 @@ + + */ +class GetRestoreStatus200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getRestoreStatus_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'restore_id' => 'string', + 'org_name' => 'string', + 'app_name' => 'string', + 'env_name' => 'string', + 'backup_id' => 'string', + 'status' => 'string', + 'started_at' => '\DateTime', + 'completed_at' => '\DateTime', + 'error_message' => 'string', + 'task_arn' => 'string', + 'ttl' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'restore_id' => null, + 'org_name' => null, + 'app_name' => null, + 'env_name' => null, + 'backup_id' => null, + 'status' => null, + 'started_at' => 'date-time', + 'completed_at' => 'date-time', + 'error_message' => null, + 'task_arn' => null, + 'ttl' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'restore_id' => false, + 'org_name' => false, + 'app_name' => false, + 'env_name' => false, + 'backup_id' => false, + 'status' => false, + 'started_at' => false, + 'completed_at' => true, + 'error_message' => true, + 'task_arn' => true, + 'ttl' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'restore_id' => 'restoreId', + 'org_name' => 'orgName', + 'app_name' => 'appName', + 'env_name' => 'envName', + 'backup_id' => 'backupId', + 'status' => 'status', + 'started_at' => 'startedAt', + 'completed_at' => 'completedAt', + 'error_message' => 'errorMessage', + 'task_arn' => 'taskArn', + 'ttl' => 'ttl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'restore_id' => 'setRestoreId', + 'org_name' => 'setOrgName', + 'app_name' => 'setAppName', + 'env_name' => 'setEnvName', + 'backup_id' => 'setBackupId', + 'status' => 'setStatus', + 'started_at' => 'setStartedAt', + 'completed_at' => 'setCompletedAt', + 'error_message' => 'setErrorMessage', + 'task_arn' => 'setTaskArn', + 'ttl' => 'setTtl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'restore_id' => 'getRestoreId', + 'org_name' => 'getOrgName', + 'app_name' => 'getAppName', + 'env_name' => 'getEnvName', + 'backup_id' => 'getBackupId', + 'status' => 'getStatus', + 'started_at' => 'getStartedAt', + 'completed_at' => 'getCompletedAt', + 'error_message' => 'getErrorMessage', + 'task_arn' => 'getTaskArn', + 'ttl' => 'getTtl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_PENDING = 'pending'; + public const STATUS_IN_PROGRESS = 'in_progress'; + public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_PENDING, + self::STATUS_IN_PROGRESS, + self::STATUS_COMPLETED, + self::STATUS_FAILED, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('restore_id', $data ?? [], null); + $this->setIfExists('org_name', $data ?? [], null); + $this->setIfExists('app_name', $data ?? [], null); + $this->setIfExists('env_name', $data ?? [], null); + $this->setIfExists('backup_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('started_at', $data ?? [], null); + $this->setIfExists('completed_at', $data ?? [], null); + $this->setIfExists('error_message', $data ?? [], null); + $this->setIfExists('task_arn', $data ?? [], null); + $this->setIfExists('ttl', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets restore_id + * + * @return string|null + */ + public function getRestoreId() + { + return $this->container['restore_id']; + } + + /** + * Sets restore_id + * + * @param string|null $restore_id restore_id + * + * @return self + */ + public function setRestoreId($restore_id) + { + if (is_null($restore_id)) { + throw new \InvalidArgumentException('non-nullable restore_id cannot be null'); + } + $this->container['restore_id'] = $restore_id; + + return $this; + } + + /** + * Gets org_name + * + * @return string|null + */ + public function getOrgName() + { + return $this->container['org_name']; + } + + /** + * Sets org_name + * + * @param string|null $org_name org_name + * + * @return self + */ + public function setOrgName($org_name) + { + if (is_null($org_name)) { + throw new \InvalidArgumentException('non-nullable org_name cannot be null'); + } + $this->container['org_name'] = $org_name; + + return $this; + } + + /** + * Gets app_name + * + * @return string|null + */ + public function getAppName() + { + return $this->container['app_name']; + } + + /** + * Sets app_name + * + * @param string|null $app_name app_name + * + * @return self + */ + public function setAppName($app_name) + { + if (is_null($app_name)) { + throw new \InvalidArgumentException('non-nullable app_name cannot be null'); + } + $this->container['app_name'] = $app_name; + + return $this; + } + + /** + * Gets env_name + * + * @return string|null + */ + public function getEnvName() + { + return $this->container['env_name']; + } + + /** + * Sets env_name + * + * @param string|null $env_name env_name + * + * @return self + */ + public function setEnvName($env_name) + { + if (is_null($env_name)) { + throw new \InvalidArgumentException('non-nullable env_name cannot be null'); + } + $this->container['env_name'] = $env_name; + + return $this; + } + + /** + * Gets backup_id + * + * @return string|null + */ + public function getBackupId() + { + return $this->container['backup_id']; + } + + /** + * Sets backup_id + * + * @param string|null $backup_id backup_id + * + * @return self + */ + public function setBackupId($backup_id) + { + if (is_null($backup_id)) { + throw new \InvalidArgumentException('non-nullable backup_id cannot be null'); + } + $this->container['backup_id'] = $backup_id; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets started_at + * + * @return \DateTime|null + */ + public function getStartedAt() + { + return $this->container['started_at']; + } + + /** + * Sets started_at + * + * @param \DateTime|null $started_at started_at + * + * @return self + */ + public function setStartedAt($started_at) + { + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + } + $this->container['started_at'] = $started_at; + + return $this; + } + + /** + * Gets completed_at + * + * @return \DateTime|null + */ + public function getCompletedAt() + { + return $this->container['completed_at']; + } + + /** + * Sets completed_at + * + * @param \DateTime|null $completed_at completed_at + * + * @return self + */ + public function setCompletedAt($completed_at) + { + if (is_null($completed_at)) { + array_push($this->openAPINullablesSetToNull, 'completed_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('completed_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['completed_at'] = $completed_at; + + return $this; + } + + /** + * Gets error_message + * + * @return string|null + */ + public function getErrorMessage() + { + return $this->container['error_message']; + } + + /** + * Sets error_message + * + * @param string|null $error_message error_message + * + * @return self + */ + public function setErrorMessage($error_message) + { + if (is_null($error_message)) { + array_push($this->openAPINullablesSetToNull, 'error_message'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('error_message', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['error_message'] = $error_message; + + return $this; + } + + /** + * Gets task_arn + * + * @return string|null + */ + public function getTaskArn() + { + return $this->container['task_arn']; + } + + /** + * Sets task_arn + * + * @param string|null $task_arn task_arn + * + * @return self + */ + public function setTaskArn($task_arn) + { + if (is_null($task_arn)) { + array_push($this->openAPINullablesSetToNull, 'task_arn'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('task_arn', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['task_arn'] = $task_arn; + + return $this; + } + + /** + * Gets ttl + * + * @return int|null + */ + public function getTtl() + { + return $this->container['ttl']; + } + + /** + * Sets ttl + * + * @param int|null $ttl ttl + * + * @return self + */ + public function setTtl($ttl) + { + if (is_null($ttl)) { + array_push($this->openAPINullablesSetToNull, 'ttl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ttl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['ttl'] = $ttl; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetScalingPolicyResponse.php b/src/Model/GetScalingPolicyResponse.php new file mode 100644 index 00000000..1b6b6537 --- /dev/null +++ b/src/Model/GetScalingPolicyResponse.php @@ -0,0 +1,622 @@ + + */ +class GetScalingPolicyResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetScalingPolicyResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'metric' => 'string', + 'target_value' => 'float', + 'scale_in_cooldown_seconds' => 'int', + 'scale_out_cooldown_seconds' => 'int', + 'policy_name' => 'string', + 'resource_label' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'metric' => null, + 'target_value' => 'double', + 'scale_in_cooldown_seconds' => null, + 'scale_out_cooldown_seconds' => null, + 'policy_name' => null, + 'resource_label' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'metric' => false, + 'target_value' => false, + 'scale_in_cooldown_seconds' => false, + 'scale_out_cooldown_seconds' => false, + 'policy_name' => false, + 'resource_label' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'metric' => 'metric', + 'target_value' => 'targetValue', + 'scale_in_cooldown_seconds' => 'scaleInCooldownSeconds', + 'scale_out_cooldown_seconds' => 'scaleOutCooldownSeconds', + 'policy_name' => 'policyName', + 'resource_label' => 'resourceLabel' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'metric' => 'setMetric', + 'target_value' => 'setTargetValue', + 'scale_in_cooldown_seconds' => 'setScaleInCooldownSeconds', + 'scale_out_cooldown_seconds' => 'setScaleOutCooldownSeconds', + 'policy_name' => 'setPolicyName', + 'resource_label' => 'setResourceLabel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'metric' => 'getMetric', + 'target_value' => 'getTargetValue', + 'scale_in_cooldown_seconds' => 'getScaleInCooldownSeconds', + 'scale_out_cooldown_seconds' => 'getScaleOutCooldownSeconds', + 'policy_name' => 'getPolicyName', + 'resource_label' => 'getResourceLabel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const METRIC_CPU_UTILIZATION = 'CPUUtilization'; + public const METRIC_MEMORY_UTILIZATION = 'MemoryUtilization'; + public const METRIC_RPS = 'RPS'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMetricAllowableValues() + { + return [ + self::METRIC_CPU_UTILIZATION, + self::METRIC_MEMORY_UTILIZATION, + self::METRIC_RPS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('metric', $data ?? [], null); + $this->setIfExists('target_value', $data ?? [], null); + $this->setIfExists('scale_in_cooldown_seconds', $data ?? [], null); + $this->setIfExists('scale_out_cooldown_seconds', $data ?? [], null); + $this->setIfExists('policy_name', $data ?? [], null); + $this->setIfExists('resource_label', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getMetricAllowableValues(); + if (!is_null($this->container['metric']) && !in_array($this->container['metric'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'metric', must be one of '%s'", + $this->container['metric'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets metric + * + * @return string|null + */ + public function getMetric() + { + return $this->container['metric']; + } + + /** + * Sets metric + * + * @param string|null $metric metric + * + * @return self + */ + public function setMetric($metric) + { + if (is_null($metric)) { + throw new \InvalidArgumentException('non-nullable metric cannot be null'); + } + $allowedValues = $this->getMetricAllowableValues(); + if (!in_array($metric, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'metric', must be one of '%s'", + $metric, + implode("', '", $allowedValues) + ) + ); + } + $this->container['metric'] = $metric; + + return $this; + } + + /** + * Gets target_value + * + * @return float|null + */ + public function getTargetValue() + { + return $this->container['target_value']; + } + + /** + * Sets target_value + * + * @param float|null $target_value target_value + * + * @return self + */ + public function setTargetValue($target_value) + { + if (is_null($target_value)) { + throw new \InvalidArgumentException('non-nullable target_value cannot be null'); + } + $this->container['target_value'] = $target_value; + + return $this; + } + + /** + * Gets scale_in_cooldown_seconds + * + * @return int|null + */ + public function getScaleInCooldownSeconds() + { + return $this->container['scale_in_cooldown_seconds']; + } + + /** + * Sets scale_in_cooldown_seconds + * + * @param int|null $scale_in_cooldown_seconds scale_in_cooldown_seconds + * + * @return self + */ + public function setScaleInCooldownSeconds($scale_in_cooldown_seconds) + { + if (is_null($scale_in_cooldown_seconds)) { + throw new \InvalidArgumentException('non-nullable scale_in_cooldown_seconds cannot be null'); + } + $this->container['scale_in_cooldown_seconds'] = $scale_in_cooldown_seconds; + + return $this; + } + + /** + * Gets scale_out_cooldown_seconds + * + * @return int|null + */ + public function getScaleOutCooldownSeconds() + { + return $this->container['scale_out_cooldown_seconds']; + } + + /** + * Sets scale_out_cooldown_seconds + * + * @param int|null $scale_out_cooldown_seconds scale_out_cooldown_seconds + * + * @return self + */ + public function setScaleOutCooldownSeconds($scale_out_cooldown_seconds) + { + if (is_null($scale_out_cooldown_seconds)) { + throw new \InvalidArgumentException('non-nullable scale_out_cooldown_seconds cannot be null'); + } + $this->container['scale_out_cooldown_seconds'] = $scale_out_cooldown_seconds; + + return $this; + } + + /** + * Gets policy_name + * + * @return string|null + */ + public function getPolicyName() + { + return $this->container['policy_name']; + } + + /** + * Sets policy_name + * + * @param string|null $policy_name Name of the underlying Application Auto Scaling policy. + * + * @return self + */ + public function setPolicyName($policy_name) + { + if (is_null($policy_name)) { + throw new \InvalidArgumentException('non-nullable policy_name cannot be null'); + } + $this->container['policy_name'] = $policy_name; + + return $this; + } + + /** + * Gets resource_label + * + * @return string|null + */ + public function getResourceLabel() + { + return $this->container['resource_label']; + } + + /** + * Sets resource_label + * + * @param string|null $resource_label ALB ResourceLabel for RPS policies (target group identifier). + * + * @return self + */ + public function setResourceLabel($resource_label) + { + if (is_null($resource_label)) { + array_push($this->openAPINullablesSetToNull, 'resource_label'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('resource_label', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['resource_label'] = $resource_label; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetSkill200Response.php b/src/Model/GetSkill200Response.php new file mode 100644 index 00000000..1481d66e --- /dev/null +++ b/src/Model/GetSkill200Response.php @@ -0,0 +1,409 @@ + + */ +class GetSkill200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getSkill_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'skill' => '\QuantClient\Model\GetSkill200ResponseSkill' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'skill' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'skill' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'skill' => 'skill' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'skill' => 'setSkill' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'skill' => 'getSkill' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('skill', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets skill + * + * @return \QuantClient\Model\GetSkill200ResponseSkill|null + */ + public function getSkill() + { + return $this->container['skill']; + } + + /** + * Sets skill + * + * @param \QuantClient\Model\GetSkill200ResponseSkill|null $skill skill + * + * @return self + */ + public function setSkill($skill) + { + if (is_null($skill)) { + throw new \InvalidArgumentException('non-nullable skill cannot be null'); + } + $this->container['skill'] = $skill; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetSkill200ResponseSkill.php b/src/Model/GetSkill200ResponseSkill.php new file mode 100644 index 00000000..6810ca6d --- /dev/null +++ b/src/Model/GetSkill200ResponseSkill.php @@ -0,0 +1,851 @@ + + */ +class GetSkill200ResponseSkill implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getSkill_200_response_skill'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'skill_id' => 'string', + 'name' => 'string', + 'description' => 'string', + 'content' => 'string', + 'trigger_condition' => 'string', + 'tags' => 'string[]', + 'source' => 'object', + 'required_tools' => 'string[]', + 'files' => 'object', + 'namespace' => 'string', + 'disable_model_invocation' => 'bool', + 'allowed_tools' => 'string[]', + 'installed_at' => '\DateTime', + 'updated_at' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'skill_id' => null, + 'name' => null, + 'description' => null, + 'content' => null, + 'trigger_condition' => null, + 'tags' => null, + 'source' => null, + 'required_tools' => null, + 'files' => null, + 'namespace' => null, + 'disable_model_invocation' => null, + 'allowed_tools' => null, + 'installed_at' => 'date-time', + 'updated_at' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'skill_id' => false, + 'name' => false, + 'description' => false, + 'content' => false, + 'trigger_condition' => false, + 'tags' => false, + 'source' => false, + 'required_tools' => false, + 'files' => false, + 'namespace' => false, + 'disable_model_invocation' => false, + 'allowed_tools' => false, + 'installed_at' => false, + 'updated_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'skill_id' => 'skillId', + 'name' => 'name', + 'description' => 'description', + 'content' => 'content', + 'trigger_condition' => 'triggerCondition', + 'tags' => 'tags', + 'source' => 'source', + 'required_tools' => 'requiredTools', + 'files' => 'files', + 'namespace' => 'namespace', + 'disable_model_invocation' => 'disableModelInvocation', + 'allowed_tools' => 'allowedTools', + 'installed_at' => 'installedAt', + 'updated_at' => 'updatedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'skill_id' => 'setSkillId', + 'name' => 'setName', + 'description' => 'setDescription', + 'content' => 'setContent', + 'trigger_condition' => 'setTriggerCondition', + 'tags' => 'setTags', + 'source' => 'setSource', + 'required_tools' => 'setRequiredTools', + 'files' => 'setFiles', + 'namespace' => 'setNamespace', + 'disable_model_invocation' => 'setDisableModelInvocation', + 'allowed_tools' => 'setAllowedTools', + 'installed_at' => 'setInstalledAt', + 'updated_at' => 'setUpdatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'skill_id' => 'getSkillId', + 'name' => 'getName', + 'description' => 'getDescription', + 'content' => 'getContent', + 'trigger_condition' => 'getTriggerCondition', + 'tags' => 'getTags', + 'source' => 'getSource', + 'required_tools' => 'getRequiredTools', + 'files' => 'getFiles', + 'namespace' => 'getNamespace', + 'disable_model_invocation' => 'getDisableModelInvocation', + 'allowed_tools' => 'getAllowedTools', + 'installed_at' => 'getInstalledAt', + 'updated_at' => 'getUpdatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('skill_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('trigger_condition', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('source', $data ?? [], null); + $this->setIfExists('required_tools', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('namespace', $data ?? [], null); + $this->setIfExists('disable_model_invocation', $data ?? [], null); + $this->setIfExists('allowed_tools', $data ?? [], null); + $this->setIfExists('installed_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets skill_id + * + * @return string|null + */ + public function getSkillId() + { + return $this->container['skill_id']; + } + + /** + * Sets skill_id + * + * @param string|null $skill_id skill_id + * + * @return self + */ + public function setSkillId($skill_id) + { + if (is_null($skill_id)) { + throw new \InvalidArgumentException('non-nullable skill_id cannot be null'); + } + $this->container['skill_id'] = $skill_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content content + * + * @return self + */ + public function setContent($content) + { + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets trigger_condition + * + * @return string|null + */ + public function getTriggerCondition() + { + return $this->container['trigger_condition']; + } + + /** + * Sets trigger_condition + * + * @param string|null $trigger_condition trigger_condition + * + * @return self + */ + public function setTriggerCondition($trigger_condition) + { + if (is_null($trigger_condition)) { + throw new \InvalidArgumentException('non-nullable trigger_condition cannot be null'); + } + $this->container['trigger_condition'] = $trigger_condition; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return self + */ + public function setTags($tags) + { + if (is_null($tags)) { + throw new \InvalidArgumentException('non-nullable tags cannot be null'); + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets source + * + * @return object|null + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param object|null $source source + * + * @return self + */ + public function setSource($source) + { + if (is_null($source)) { + throw new \InvalidArgumentException('non-nullable source cannot be null'); + } + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets required_tools + * + * @return string[]|null + */ + public function getRequiredTools() + { + return $this->container['required_tools']; + } + + /** + * Sets required_tools + * + * @param string[]|null $required_tools required_tools + * + * @return self + */ + public function setRequiredTools($required_tools) + { + if (is_null($required_tools)) { + throw new \InvalidArgumentException('non-nullable required_tools cannot be null'); + } + $this->container['required_tools'] = $required_tools; + + return $this; + } + + /** + * Gets files + * + * @return object|null + */ + public function getFiles() + { + return $this->container['files']; + } + + /** + * Sets files + * + * @param object|null $files files + * + * @return self + */ + public function setFiles($files) + { + if (is_null($files)) { + throw new \InvalidArgumentException('non-nullable files cannot be null'); + } + $this->container['files'] = $files; + + return $this; + } + + /** + * Gets namespace + * + * @return string|null + */ + public function getNamespace() + { + return $this->container['namespace']; + } + + /** + * Sets namespace + * + * @param string|null $namespace namespace + * + * @return self + */ + public function setNamespace($namespace) + { + if (is_null($namespace)) { + throw new \InvalidArgumentException('non-nullable namespace cannot be null'); + } + $this->container['namespace'] = $namespace; + + return $this; + } + + /** + * Gets disable_model_invocation + * + * @return bool|null + */ + public function getDisableModelInvocation() + { + return $this->container['disable_model_invocation']; + } + + /** + * Sets disable_model_invocation + * + * @param bool|null $disable_model_invocation disable_model_invocation + * + * @return self + */ + public function setDisableModelInvocation($disable_model_invocation) + { + if (is_null($disable_model_invocation)) { + throw new \InvalidArgumentException('non-nullable disable_model_invocation cannot be null'); + } + $this->container['disable_model_invocation'] = $disable_model_invocation; + + return $this; + } + + /** + * Gets allowed_tools + * + * @return string[]|null + */ + public function getAllowedTools() + { + return $this->container['allowed_tools']; + } + + /** + * Sets allowed_tools + * + * @param string[]|null $allowed_tools allowed_tools + * + * @return self + */ + public function setAllowedTools($allowed_tools) + { + if (is_null($allowed_tools)) { + throw new \InvalidArgumentException('non-nullable allowed_tools cannot be null'); + } + $this->container['allowed_tools'] = $allowed_tools; + + return $this; + } + + /** + * Gets installed_at + * + * @return \DateTime|null + */ + public function getInstalledAt() + { + return $this->container['installed_at']; + } + + /** + * Sets installed_at + * + * @param \DateTime|null $installed_at installed_at + * + * @return self + */ + public function setInstalledAt($installed_at) + { + if (is_null($installed_at)) { + throw new \InvalidArgumentException('non-nullable installed_at cannot be null'); + } + $this->container['installed_at'] = $installed_at; + + return $this; + } + + /** + * Gets updated_at + * + * @return \DateTime|null + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param \DateTime|null $updated_at updated_at + * + * @return self + */ + public function setUpdatedAt($updated_at) + { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } + $this->container['updated_at'] = $updated_at; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetSlackBot200Response.php b/src/Model/GetSlackBot200Response.php new file mode 100644 index 00000000..92685eb9 --- /dev/null +++ b/src/Model/GetSlackBot200Response.php @@ -0,0 +1,409 @@ + + */ +class GetSlackBot200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getSlackBot_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bot' => '\QuantClient\Model\GetSlackBot200ResponseBot' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bot' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'bot' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'bot' => 'bot' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bot' => 'setBot' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bot' => 'getBot' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('bot', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bot + * + * @return \QuantClient\Model\GetSlackBot200ResponseBot|null + */ + public function getBot() + { + return $this->container['bot']; + } + + /** + * Sets bot + * + * @param \QuantClient\Model\GetSlackBot200ResponseBot|null $bot bot + * + * @return self + */ + public function setBot($bot) + { + if (is_null($bot)) { + throw new \InvalidArgumentException('non-nullable bot cannot be null'); + } + $this->container['bot'] = $bot; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetSlackBot200ResponseBot.php b/src/Model/GetSlackBot200ResponseBot.php new file mode 100644 index 00000000..c6122dc9 --- /dev/null +++ b/src/Model/GetSlackBot200ResponseBot.php @@ -0,0 +1,1361 @@ + + */ +class GetSlackBot200ResponseBot implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getSlackBot_200_response_bot'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bot_id' => 'string', + 'name' => 'string', + 'setup_type' => 'string', + 'status' => 'string', + 'connected' => 'bool', + 'system_prompt' => 'string', + 'model_id' => 'string', + 'temperature' => 'float', + 'max_tokens' => 'int', + 'allowed_tools' => 'string[]', + 'assigned_skills' => 'string[]', + 'allowed_collections' => 'string[]', + 'allowed_sub_agents' => 'string[]', + 'guardrail_preset' => 'string', + 'filter_policies' => 'string[]', + 'long_context' => 'bool', + 'session_ttl_days' => 'int', + 'allowed_channels' => 'string[]', + 'allowed_users' => 'string[]', + 'denied_users' => 'string[]', + 'allow_guests' => 'bool', + 'home_tab_content' => 'string', + 'agent_access_control' => 'object', + 'keywords_enabled' => 'bool', + 'keywords' => 'string[]', + 'created_at' => '\DateTime', + 'updated_at' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bot_id' => null, + 'name' => null, + 'setup_type' => null, + 'status' => null, + 'connected' => null, + 'system_prompt' => null, + 'model_id' => null, + 'temperature' => null, + 'max_tokens' => null, + 'allowed_tools' => null, + 'assigned_skills' => null, + 'allowed_collections' => null, + 'allowed_sub_agents' => null, + 'guardrail_preset' => null, + 'filter_policies' => null, + 'long_context' => null, + 'session_ttl_days' => null, + 'allowed_channels' => null, + 'allowed_users' => null, + 'denied_users' => null, + 'allow_guests' => null, + 'home_tab_content' => null, + 'agent_access_control' => null, + 'keywords_enabled' => null, + 'keywords' => null, + 'created_at' => 'date-time', + 'updated_at' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'bot_id' => false, + 'name' => false, + 'setup_type' => false, + 'status' => false, + 'connected' => false, + 'system_prompt' => false, + 'model_id' => false, + 'temperature' => false, + 'max_tokens' => false, + 'allowed_tools' => false, + 'assigned_skills' => false, + 'allowed_collections' => false, + 'allowed_sub_agents' => false, + 'guardrail_preset' => false, + 'filter_policies' => false, + 'long_context' => false, + 'session_ttl_days' => false, + 'allowed_channels' => false, + 'allowed_users' => false, + 'denied_users' => false, + 'allow_guests' => false, + 'home_tab_content' => false, + 'agent_access_control' => false, + 'keywords_enabled' => false, + 'keywords' => false, + 'created_at' => false, + 'updated_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'bot_id' => 'botId', + 'name' => 'name', + 'setup_type' => 'setupType', + 'status' => 'status', + 'connected' => 'connected', + 'system_prompt' => 'systemPrompt', + 'model_id' => 'modelId', + 'temperature' => 'temperature', + 'max_tokens' => 'maxTokens', + 'allowed_tools' => 'allowedTools', + 'assigned_skills' => 'assignedSkills', + 'allowed_collections' => 'allowedCollections', + 'allowed_sub_agents' => 'allowedSubAgents', + 'guardrail_preset' => 'guardrailPreset', + 'filter_policies' => 'filterPolicies', + 'long_context' => 'longContext', + 'session_ttl_days' => 'sessionTtlDays', + 'allowed_channels' => 'allowedChannels', + 'allowed_users' => 'allowedUsers', + 'denied_users' => 'deniedUsers', + 'allow_guests' => 'allowGuests', + 'home_tab_content' => 'homeTabContent', + 'agent_access_control' => 'agentAccessControl', + 'keywords_enabled' => 'keywordsEnabled', + 'keywords' => 'keywords', + 'created_at' => 'createdAt', + 'updated_at' => 'updatedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bot_id' => 'setBotId', + 'name' => 'setName', + 'setup_type' => 'setSetupType', + 'status' => 'setStatus', + 'connected' => 'setConnected', + 'system_prompt' => 'setSystemPrompt', + 'model_id' => 'setModelId', + 'temperature' => 'setTemperature', + 'max_tokens' => 'setMaxTokens', + 'allowed_tools' => 'setAllowedTools', + 'assigned_skills' => 'setAssignedSkills', + 'allowed_collections' => 'setAllowedCollections', + 'allowed_sub_agents' => 'setAllowedSubAgents', + 'guardrail_preset' => 'setGuardrailPreset', + 'filter_policies' => 'setFilterPolicies', + 'long_context' => 'setLongContext', + 'session_ttl_days' => 'setSessionTtlDays', + 'allowed_channels' => 'setAllowedChannels', + 'allowed_users' => 'setAllowedUsers', + 'denied_users' => 'setDeniedUsers', + 'allow_guests' => 'setAllowGuests', + 'home_tab_content' => 'setHomeTabContent', + 'agent_access_control' => 'setAgentAccessControl', + 'keywords_enabled' => 'setKeywordsEnabled', + 'keywords' => 'setKeywords', + 'created_at' => 'setCreatedAt', + 'updated_at' => 'setUpdatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bot_id' => 'getBotId', + 'name' => 'getName', + 'setup_type' => 'getSetupType', + 'status' => 'getStatus', + 'connected' => 'getConnected', + 'system_prompt' => 'getSystemPrompt', + 'model_id' => 'getModelId', + 'temperature' => 'getTemperature', + 'max_tokens' => 'getMaxTokens', + 'allowed_tools' => 'getAllowedTools', + 'assigned_skills' => 'getAssignedSkills', + 'allowed_collections' => 'getAllowedCollections', + 'allowed_sub_agents' => 'getAllowedSubAgents', + 'guardrail_preset' => 'getGuardrailPreset', + 'filter_policies' => 'getFilterPolicies', + 'long_context' => 'getLongContext', + 'session_ttl_days' => 'getSessionTtlDays', + 'allowed_channels' => 'getAllowedChannels', + 'allowed_users' => 'getAllowedUsers', + 'denied_users' => 'getDeniedUsers', + 'allow_guests' => 'getAllowGuests', + 'home_tab_content' => 'getHomeTabContent', + 'agent_access_control' => 'getAgentAccessControl', + 'keywords_enabled' => 'getKeywordsEnabled', + 'keywords' => 'getKeywords', + 'created_at' => 'getCreatedAt', + 'updated_at' => 'getUpdatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const SETUP_TYPE_QUANT = 'quant'; + public const SETUP_TYPE_BYO = 'byo'; + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSetupTypeAllowableValues() + { + return [ + self::SETUP_TYPE_QUANT, + self::SETUP_TYPE_BYO, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('bot_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('setup_type', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('connected', $data ?? [], null); + $this->setIfExists('system_prompt', $data ?? [], null); + $this->setIfExists('model_id', $data ?? [], null); + $this->setIfExists('temperature', $data ?? [], null); + $this->setIfExists('max_tokens', $data ?? [], null); + $this->setIfExists('allowed_tools', $data ?? [], null); + $this->setIfExists('assigned_skills', $data ?? [], null); + $this->setIfExists('allowed_collections', $data ?? [], null); + $this->setIfExists('allowed_sub_agents', $data ?? [], null); + $this->setIfExists('guardrail_preset', $data ?? [], null); + $this->setIfExists('filter_policies', $data ?? [], null); + $this->setIfExists('long_context', $data ?? [], null); + $this->setIfExists('session_ttl_days', $data ?? [], null); + $this->setIfExists('allowed_channels', $data ?? [], null); + $this->setIfExists('allowed_users', $data ?? [], null); + $this->setIfExists('denied_users', $data ?? [], null); + $this->setIfExists('allow_guests', $data ?? [], null); + $this->setIfExists('home_tab_content', $data ?? [], null); + $this->setIfExists('agent_access_control', $data ?? [], null); + $this->setIfExists('keywords_enabled', $data ?? [], null); + $this->setIfExists('keywords', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getSetupTypeAllowableValues(); + if (!is_null($this->container['setup_type']) && !in_array($this->container['setup_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'setup_type', must be one of '%s'", + $this->container['setup_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bot_id + * + * @return string|null + */ + public function getBotId() + { + return $this->container['bot_id']; + } + + /** + * Sets bot_id + * + * @param string|null $bot_id bot_id + * + * @return self + */ + public function setBotId($bot_id) + { + if (is_null($bot_id)) { + throw new \InvalidArgumentException('non-nullable bot_id cannot be null'); + } + $this->container['bot_id'] = $bot_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets setup_type + * + * @return string|null + */ + public function getSetupType() + { + return $this->container['setup_type']; + } + + /** + * Sets setup_type + * + * @param string|null $setup_type setup_type + * + * @return self + */ + public function setSetupType($setup_type) + { + if (is_null($setup_type)) { + throw new \InvalidArgumentException('non-nullable setup_type cannot be null'); + } + $allowedValues = $this->getSetupTypeAllowableValues(); + if (!in_array($setup_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'setup_type', must be one of '%s'", + $setup_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['setup_type'] = $setup_type; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets connected + * + * @return bool|null + */ + public function getConnected() + { + return $this->container['connected']; + } + + /** + * Sets connected + * + * @param bool|null $connected connected + * + * @return self + */ + public function setConnected($connected) + { + if (is_null($connected)) { + throw new \InvalidArgumentException('non-nullable connected cannot be null'); + } + $this->container['connected'] = $connected; + + return $this; + } + + /** + * Gets system_prompt + * + * @return string|null + */ + public function getSystemPrompt() + { + return $this->container['system_prompt']; + } + + /** + * Sets system_prompt + * + * @param string|null $system_prompt system_prompt + * + * @return self + */ + public function setSystemPrompt($system_prompt) + { + if (is_null($system_prompt)) { + throw new \InvalidArgumentException('non-nullable system_prompt cannot be null'); + } + $this->container['system_prompt'] = $system_prompt; + + return $this; + } + + /** + * Gets model_id + * + * @return string|null + */ + public function getModelId() + { + return $this->container['model_id']; + } + + /** + * Sets model_id + * + * @param string|null $model_id model_id + * + * @return self + */ + public function setModelId($model_id) + { + if (is_null($model_id)) { + throw new \InvalidArgumentException('non-nullable model_id cannot be null'); + } + $this->container['model_id'] = $model_id; + + return $this; + } + + /** + * Gets temperature + * + * @return float|null + */ + public function getTemperature() + { + return $this->container['temperature']; + } + + /** + * Sets temperature + * + * @param float|null $temperature temperature + * + * @return self + */ + public function setTemperature($temperature) + { + if (is_null($temperature)) { + throw new \InvalidArgumentException('non-nullable temperature cannot be null'); + } + $this->container['temperature'] = $temperature; + + return $this; + } + + /** + * Gets max_tokens + * + * @return int|null + */ + public function getMaxTokens() + { + return $this->container['max_tokens']; + } + + /** + * Sets max_tokens + * + * @param int|null $max_tokens max_tokens + * + * @return self + */ + public function setMaxTokens($max_tokens) + { + if (is_null($max_tokens)) { + throw new \InvalidArgumentException('non-nullable max_tokens cannot be null'); + } + $this->container['max_tokens'] = $max_tokens; + + return $this; + } + + /** + * Gets allowed_tools + * + * @return string[]|null + */ + public function getAllowedTools() + { + return $this->container['allowed_tools']; + } + + /** + * Sets allowed_tools + * + * @param string[]|null $allowed_tools allowed_tools + * + * @return self + */ + public function setAllowedTools($allowed_tools) + { + if (is_null($allowed_tools)) { + throw new \InvalidArgumentException('non-nullable allowed_tools cannot be null'); + } + $this->container['allowed_tools'] = $allowed_tools; + + return $this; + } + + /** + * Gets assigned_skills + * + * @return string[]|null + */ + public function getAssignedSkills() + { + return $this->container['assigned_skills']; + } + + /** + * Sets assigned_skills + * + * @param string[]|null $assigned_skills assigned_skills + * + * @return self + */ + public function setAssignedSkills($assigned_skills) + { + if (is_null($assigned_skills)) { + throw new \InvalidArgumentException('non-nullable assigned_skills cannot be null'); + } + $this->container['assigned_skills'] = $assigned_skills; + + return $this; + } + + /** + * Gets allowed_collections + * + * @return string[]|null + */ + public function getAllowedCollections() + { + return $this->container['allowed_collections']; + } + + /** + * Sets allowed_collections + * + * @param string[]|null $allowed_collections allowed_collections + * + * @return self + */ + public function setAllowedCollections($allowed_collections) + { + if (is_null($allowed_collections)) { + throw new \InvalidArgumentException('non-nullable allowed_collections cannot be null'); + } + $this->container['allowed_collections'] = $allowed_collections; + + return $this; + } + + /** + * Gets allowed_sub_agents + * + * @return string[]|null + */ + public function getAllowedSubAgents() + { + return $this->container['allowed_sub_agents']; + } + + /** + * Sets allowed_sub_agents + * + * @param string[]|null $allowed_sub_agents allowed_sub_agents + * + * @return self + */ + public function setAllowedSubAgents($allowed_sub_agents) + { + if (is_null($allowed_sub_agents)) { + throw new \InvalidArgumentException('non-nullable allowed_sub_agents cannot be null'); + } + $this->container['allowed_sub_agents'] = $allowed_sub_agents; + + return $this; + } + + /** + * Gets guardrail_preset + * + * @return string|null + */ + public function getGuardrailPreset() + { + return $this->container['guardrail_preset']; + } + + /** + * Sets guardrail_preset + * + * @param string|null $guardrail_preset guardrail_preset + * + * @return self + */ + public function setGuardrailPreset($guardrail_preset) + { + if (is_null($guardrail_preset)) { + throw new \InvalidArgumentException('non-nullable guardrail_preset cannot be null'); + } + $this->container['guardrail_preset'] = $guardrail_preset; + + return $this; + } + + /** + * Gets filter_policies + * + * @return string[]|null + */ + public function getFilterPolicies() + { + return $this->container['filter_policies']; + } + + /** + * Sets filter_policies + * + * @param string[]|null $filter_policies filter_policies + * + * @return self + */ + public function setFilterPolicies($filter_policies) + { + if (is_null($filter_policies)) { + throw new \InvalidArgumentException('non-nullable filter_policies cannot be null'); + } + $this->container['filter_policies'] = $filter_policies; + + return $this; + } + + /** + * Gets long_context + * + * @return bool|null + */ + public function getLongContext() + { + return $this->container['long_context']; + } + + /** + * Sets long_context + * + * @param bool|null $long_context long_context + * + * @return self + */ + public function setLongContext($long_context) + { + if (is_null($long_context)) { + throw new \InvalidArgumentException('non-nullable long_context cannot be null'); + } + $this->container['long_context'] = $long_context; + + return $this; + } + + /** + * Gets session_ttl_days + * + * @return int|null + */ + public function getSessionTtlDays() + { + return $this->container['session_ttl_days']; + } + + /** + * Sets session_ttl_days + * + * @param int|null $session_ttl_days session_ttl_days + * + * @return self + */ + public function setSessionTtlDays($session_ttl_days) + { + if (is_null($session_ttl_days)) { + throw new \InvalidArgumentException('non-nullable session_ttl_days cannot be null'); + } + $this->container['session_ttl_days'] = $session_ttl_days; + + return $this; + } + + /** + * Gets allowed_channels + * + * @return string[]|null + */ + public function getAllowedChannels() + { + return $this->container['allowed_channels']; + } + + /** + * Sets allowed_channels + * + * @param string[]|null $allowed_channels allowed_channels + * + * @return self + */ + public function setAllowedChannels($allowed_channels) + { + if (is_null($allowed_channels)) { + throw new \InvalidArgumentException('non-nullable allowed_channels cannot be null'); + } + $this->container['allowed_channels'] = $allowed_channels; + + return $this; + } + + /** + * Gets allowed_users + * + * @return string[]|null + */ + public function getAllowedUsers() + { + return $this->container['allowed_users']; + } + + /** + * Sets allowed_users + * + * @param string[]|null $allowed_users allowed_users + * + * @return self + */ + public function setAllowedUsers($allowed_users) + { + if (is_null($allowed_users)) { + throw new \InvalidArgumentException('non-nullable allowed_users cannot be null'); + } + $this->container['allowed_users'] = $allowed_users; + + return $this; + } + + /** + * Gets denied_users + * + * @return string[]|null + */ + public function getDeniedUsers() + { + return $this->container['denied_users']; + } + + /** + * Sets denied_users + * + * @param string[]|null $denied_users denied_users + * + * @return self + */ + public function setDeniedUsers($denied_users) + { + if (is_null($denied_users)) { + throw new \InvalidArgumentException('non-nullable denied_users cannot be null'); + } + $this->container['denied_users'] = $denied_users; + + return $this; + } + + /** + * Gets allow_guests + * + * @return bool|null + */ + public function getAllowGuests() + { + return $this->container['allow_guests']; + } + + /** + * Sets allow_guests + * + * @param bool|null $allow_guests allow_guests + * + * @return self + */ + public function setAllowGuests($allow_guests) + { + if (is_null($allow_guests)) { + throw new \InvalidArgumentException('non-nullable allow_guests cannot be null'); + } + $this->container['allow_guests'] = $allow_guests; + + return $this; + } + + /** + * Gets home_tab_content + * + * @return string|null + */ + public function getHomeTabContent() + { + return $this->container['home_tab_content']; + } + + /** + * Sets home_tab_content + * + * @param string|null $home_tab_content home_tab_content + * + * @return self + */ + public function setHomeTabContent($home_tab_content) + { + if (is_null($home_tab_content)) { + throw new \InvalidArgumentException('non-nullable home_tab_content cannot be null'); + } + $this->container['home_tab_content'] = $home_tab_content; + + return $this; + } + + /** + * Gets agent_access_control + * + * @return object|null + */ + public function getAgentAccessControl() + { + return $this->container['agent_access_control']; + } + + /** + * Sets agent_access_control + * + * @param object|null $agent_access_control agent_access_control + * + * @return self + */ + public function setAgentAccessControl($agent_access_control) + { + if (is_null($agent_access_control)) { + throw new \InvalidArgumentException('non-nullable agent_access_control cannot be null'); + } + $this->container['agent_access_control'] = $agent_access_control; + + return $this; + } + + /** + * Gets keywords_enabled + * + * @return bool|null + */ + public function getKeywordsEnabled() + { + return $this->container['keywords_enabled']; + } + + /** + * Sets keywords_enabled + * + * @param bool|null $keywords_enabled keywords_enabled + * + * @return self + */ + public function setKeywordsEnabled($keywords_enabled) + { + if (is_null($keywords_enabled)) { + throw new \InvalidArgumentException('non-nullable keywords_enabled cannot be null'); + } + $this->container['keywords_enabled'] = $keywords_enabled; + + return $this; + } + + /** + * Gets keywords + * + * @return string[]|null + */ + public function getKeywords() + { + return $this->container['keywords']; + } + + /** + * Sets keywords + * + * @param string[]|null $keywords keywords + * + * @return self + */ + public function setKeywords($keywords) + { + if (is_null($keywords)) { + throw new \InvalidArgumentException('non-nullable keywords cannot be null'); + } + $this->container['keywords'] = $keywords; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime|null $created_at created_at + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets updated_at + * + * @return \DateTime|null + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param \DateTime|null $updated_at updated_at + * + * @return self + */ + public function setUpdatedAt($updated_at) + { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } + $this->container['updated_at'] = $updated_at; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetSshAccessCredentials200Response.php b/src/Model/GetSshAccessCredentials200Response.php index 30abf7fb..8c6852ce 100644 --- a/src/Model/GetSshAccessCredentials200Response.php +++ b/src/Model/GetSshAccessCredentials200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetSshAccessCredentials200ResponseCredentials.php b/src/Model/GetSshAccessCredentials200ResponseCredentials.php index d8d915a6..71716e10 100644 --- a/src/Model/GetSshAccessCredentials200ResponseCredentials.php +++ b/src/Model/GetSshAccessCredentials200ResponseCredentials.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetTask200Response.php b/src/Model/GetTask200Response.php index 8c09371e..0470a912 100644 --- a/src/Model/GetTask200Response.php +++ b/src/Model/GetTask200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetVectorCollection200Response.php b/src/Model/GetVectorCollection200Response.php index de78f88c..43840a06 100644 --- a/src/Model/GetVectorCollection200Response.php +++ b/src/Model/GetVectorCollection200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/GetVectorCollection200ResponseCollection.php b/src/Model/GetVectorCollection200ResponseCollection.php index cb01135d..86c92b28 100644 --- a/src/Model/GetVectorCollection200ResponseCollection.php +++ b/src/Model/GetVectorCollection200ResponseCollection.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ImageGeneration200Response.php b/src/Model/ImageGeneration200Response.php index 8c1a46ae..2f1d6380 100644 --- a/src/Model/ImageGeneration200Response.php +++ b/src/Model/ImageGeneration200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ImageGenerationRequest.php b/src/Model/ImageGenerationRequest.php index e257418d..3f53432d 100644 --- a/src/Model/ImageGenerationRequest.php +++ b/src/Model/ImageGenerationRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ImageGenerationRequestBackgroundRemovalParams.php b/src/Model/ImageGenerationRequestBackgroundRemovalParams.php index 9c368a90..e3207406 100644 --- a/src/Model/ImageGenerationRequestBackgroundRemovalParams.php +++ b/src/Model/ImageGenerationRequestBackgroundRemovalParams.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ImageGenerationRequestColorGuidedGenerationParams.php b/src/Model/ImageGenerationRequestColorGuidedGenerationParams.php index d2b57ded..ec453514 100644 --- a/src/Model/ImageGenerationRequestColorGuidedGenerationParams.php +++ b/src/Model/ImageGenerationRequestColorGuidedGenerationParams.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ImageGenerationRequestImageGenerationConfig.php b/src/Model/ImageGenerationRequestImageGenerationConfig.php index 70e60163..8e05cc72 100644 --- a/src/Model/ImageGenerationRequestImageGenerationConfig.php +++ b/src/Model/ImageGenerationRequestImageGenerationConfig.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ImageGenerationRequestImageVariationParams.php b/src/Model/ImageGenerationRequestImageVariationParams.php index df9ed59d..0a60f8eb 100644 --- a/src/Model/ImageGenerationRequestImageVariationParams.php +++ b/src/Model/ImageGenerationRequestImageVariationParams.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ImageGenerationRequestInPaintingParams.php b/src/Model/ImageGenerationRequestInPaintingParams.php index 53c515e0..2008713b 100644 --- a/src/Model/ImageGenerationRequestInPaintingParams.php +++ b/src/Model/ImageGenerationRequestInPaintingParams.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ImageGenerationRequestOutPaintingParams.php b/src/Model/ImageGenerationRequestOutPaintingParams.php index 5e4df3e8..ffd6d6c8 100644 --- a/src/Model/ImageGenerationRequestOutPaintingParams.php +++ b/src/Model/ImageGenerationRequestOutPaintingParams.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ImageGenerationRequestTextToImageParams.php b/src/Model/ImageGenerationRequestTextToImageParams.php index 0afa81f1..d5ea8136 100644 --- a/src/Model/ImageGenerationRequestTextToImageParams.php +++ b/src/Model/ImageGenerationRequestTextToImageParams.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ImportSkill201Response.php b/src/Model/ImportSkill201Response.php new file mode 100644 index 00000000..891240cf --- /dev/null +++ b/src/Model/ImportSkill201Response.php @@ -0,0 +1,443 @@ + + */ +class ImportSkill201Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'importSkill_201_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'skill' => 'object', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'skill' => null, + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'skill' => false, + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'skill' => 'skill', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'skill' => 'setSkill', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'skill' => 'getSkill', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('skill', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets skill + * + * @return object|null + */ + public function getSkill() + { + return $this->container['skill']; + } + + /** + * Sets skill + * + * @param object|null $skill skill + * + * @return self + */ + public function setSkill($skill) + { + if (is_null($skill)) { + throw new \InvalidArgumentException('non-nullable skill cannot be null'); + } + $this->container['skill'] = $skill; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ImportSkillCollection201Response.php b/src/Model/ImportSkillCollection201Response.php new file mode 100644 index 00000000..d3efa5c3 --- /dev/null +++ b/src/Model/ImportSkillCollection201Response.php @@ -0,0 +1,545 @@ + + */ +class ImportSkillCollection201Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'importSkillCollection_201_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'namespace' => 'string', + 'imported' => 'int', + 'failed' => 'int', + 'skills' => 'object[]', + 'errors' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'namespace' => null, + 'imported' => null, + 'failed' => null, + 'skills' => null, + 'errors' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'namespace' => false, + 'imported' => false, + 'failed' => false, + 'skills' => false, + 'errors' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'namespace' => 'namespace', + 'imported' => 'imported', + 'failed' => 'failed', + 'skills' => 'skills', + 'errors' => 'errors' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'namespace' => 'setNamespace', + 'imported' => 'setImported', + 'failed' => 'setFailed', + 'skills' => 'setSkills', + 'errors' => 'setErrors' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'namespace' => 'getNamespace', + 'imported' => 'getImported', + 'failed' => 'getFailed', + 'skills' => 'getSkills', + 'errors' => 'getErrors' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('namespace', $data ?? [], null); + $this->setIfExists('imported', $data ?? [], null); + $this->setIfExists('failed', $data ?? [], null); + $this->setIfExists('skills', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets namespace + * + * @return string|null + */ + public function getNamespace() + { + return $this->container['namespace']; + } + + /** + * Sets namespace + * + * @param string|null $namespace namespace + * + * @return self + */ + public function setNamespace($namespace) + { + if (is_null($namespace)) { + throw new \InvalidArgumentException('non-nullable namespace cannot be null'); + } + $this->container['namespace'] = $namespace; + + return $this; + } + + /** + * Gets imported + * + * @return int|null + */ + public function getImported() + { + return $this->container['imported']; + } + + /** + * Sets imported + * + * @param int|null $imported imported + * + * @return self + */ + public function setImported($imported) + { + if (is_null($imported)) { + throw new \InvalidArgumentException('non-nullable imported cannot be null'); + } + $this->container['imported'] = $imported; + + return $this; + } + + /** + * Gets failed + * + * @return int|null + */ + public function getFailed() + { + return $this->container['failed']; + } + + /** + * Sets failed + * + * @param int|null $failed failed + * + * @return self + */ + public function setFailed($failed) + { + if (is_null($failed)) { + throw new \InvalidArgumentException('non-nullable failed cannot be null'); + } + $this->container['failed'] = $failed; + + return $this; + } + + /** + * Gets skills + * + * @return object[]|null + */ + public function getSkills() + { + return $this->container['skills']; + } + + /** + * Sets skills + * + * @param object[]|null $skills skills + * + * @return self + */ + public function setSkills($skills) + { + if (is_null($skills)) { + throw new \InvalidArgumentException('non-nullable skills cannot be null'); + } + $this->container['skills'] = $skills; + + return $this; + } + + /** + * Gets errors + * + * @return object[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param object[]|null $errors errors + * + * @return self + */ + public function setErrors($errors) + { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ImportSkillCollectionRequest.php b/src/Model/ImportSkillCollectionRequest.php new file mode 100644 index 00000000..f626d7ad --- /dev/null +++ b/src/Model/ImportSkillCollectionRequest.php @@ -0,0 +1,526 @@ + + */ +class ImportSkillCollectionRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'importSkillCollection_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'namespace' => 'string', + 'source' => '\QuantClient\Model\ImportSkillCollectionRequestSource', + 'tags' => 'string[]', + 'installed_by' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'namespace' => null, + 'source' => null, + 'tags' => null, + 'installed_by' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'namespace' => false, + 'source' => false, + 'tags' => false, + 'installed_by' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'namespace' => 'namespace', + 'source' => 'source', + 'tags' => 'tags', + 'installed_by' => 'installedBy' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'namespace' => 'setNamespace', + 'source' => 'setSource', + 'tags' => 'setTags', + 'installed_by' => 'setInstalledBy' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'namespace' => 'getNamespace', + 'source' => 'getSource', + 'tags' => 'getTags', + 'installed_by' => 'getInstalledBy' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('namespace', $data ?? [], null); + $this->setIfExists('source', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('installed_by', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['namespace'] === null) { + $invalidProperties[] = "'namespace' can't be null"; + } + if (!preg_match("/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/", $this->container['namespace'])) { + $invalidProperties[] = "invalid value for 'namespace', must be conform to the pattern /^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/."; + } + + if ($this->container['source'] === null) { + $invalidProperties[] = "'source' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets namespace + * + * @return string + */ + public function getNamespace() + { + return $this->container['namespace']; + } + + /** + * Sets namespace + * + * @param string $namespace namespace + * + * @return self + */ + public function setNamespace($namespace) + { + if (is_null($namespace)) { + throw new \InvalidArgumentException('non-nullable namespace cannot be null'); + } + + if ((!preg_match("/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/", ObjectSerializer::toString($namespace)))) { + throw new \InvalidArgumentException("invalid value for \$namespace when calling ImportSkillCollectionRequest., must conform to the pattern /^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/."); + } + + $this->container['namespace'] = $namespace; + + return $this; + } + + /** + * Gets source + * + * @return \QuantClient\Model\ImportSkillCollectionRequestSource + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param \QuantClient\Model\ImportSkillCollectionRequestSource $source source + * + * @return self + */ + public function setSource($source) + { + if (is_null($source)) { + throw new \InvalidArgumentException('non-nullable source cannot be null'); + } + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return self + */ + public function setTags($tags) + { + if (is_null($tags)) { + throw new \InvalidArgumentException('non-nullable tags cannot be null'); + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets installed_by + * + * @return string|null + */ + public function getInstalledBy() + { + return $this->container['installed_by']; + } + + /** + * Sets installed_by + * + * @param string|null $installed_by installed_by + * + * @return self + */ + public function setInstalledBy($installed_by) + { + if (is_null($installed_by)) { + throw new \InvalidArgumentException('non-nullable installed_by cannot be null'); + } + $this->container['installed_by'] = $installed_by; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ImportSkillCollectionRequestSource.php b/src/Model/ImportSkillCollectionRequestSource.php new file mode 100644 index 00000000..875b3b74 --- /dev/null +++ b/src/Model/ImportSkillCollectionRequestSource.php @@ -0,0 +1,549 @@ + + */ +class ImportSkillCollectionRequestSource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'importSkillCollection_request_source'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'repo' => 'string', + 'path' => 'string', + 'version' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'repo' => null, + 'path' => null, + 'version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'repo' => false, + 'path' => false, + 'version' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'repo' => 'repo', + 'path' => 'path', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'repo' => 'setRepo', + 'path' => 'setPath', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'repo' => 'getRepo', + 'path' => 'getPath', + 'version' => 'getVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_GITHUB = 'github'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GITHUB, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('repo', $data ?? [], null); + $this->setIfExists('path', $data ?? [], null); + $this->setIfExists('version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['repo'] === null) { + $invalidProperties[] = "'repo' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets repo + * + * @return string + */ + public function getRepo() + { + return $this->container['repo']; + } + + /** + * Sets repo + * + * @param string $repo repo + * + * @return self + */ + public function setRepo($repo) + { + if (is_null($repo)) { + throw new \InvalidArgumentException('non-nullable repo cannot be null'); + } + $this->container['repo'] = $repo; + + return $this; + } + + /** + * Gets path + * + * @return string|null + */ + public function getPath() + { + return $this->container['path']; + } + + /** + * Sets path + * + * @param string|null $path path + * + * @return self + */ + public function setPath($path) + { + if (is_null($path)) { + throw new \InvalidArgumentException('non-nullable path cannot be null'); + } + $this->container['path'] = $path; + + return $this; + } + + /** + * Gets version + * + * @return string|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param string|null $version version + * + * @return self + */ + public function setVersion($version) + { + if (is_null($version)) { + throw new \InvalidArgumentException('non-nullable version cannot be null'); + } + $this->container['version'] = $version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ImportSkillRequest.php b/src/Model/ImportSkillRequest.php new file mode 100644 index 00000000..45457276 --- /dev/null +++ b/src/Model/ImportSkillRequest.php @@ -0,0 +1,684 @@ + + */ +class ImportSkillRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'importSkill_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'source' => '\QuantClient\Model\ImportSkillRequestSource', + 'name' => 'string', + 'description' => 'string', + 'tags' => 'string[]', + 'trigger_condition' => 'string', + 'required_tools' => 'string[]', + 'disable_model_invocation' => 'bool', + 'allowed_tools' => 'string[]', + 'installed_by' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'source' => null, + 'name' => null, + 'description' => null, + 'tags' => null, + 'trigger_condition' => null, + 'required_tools' => null, + 'disable_model_invocation' => null, + 'allowed_tools' => null, + 'installed_by' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'source' => false, + 'name' => false, + 'description' => false, + 'tags' => false, + 'trigger_condition' => false, + 'required_tools' => false, + 'disable_model_invocation' => false, + 'allowed_tools' => false, + 'installed_by' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'source' => 'source', + 'name' => 'name', + 'description' => 'description', + 'tags' => 'tags', + 'trigger_condition' => 'triggerCondition', + 'required_tools' => 'requiredTools', + 'disable_model_invocation' => 'disableModelInvocation', + 'allowed_tools' => 'allowedTools', + 'installed_by' => 'installedBy' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'source' => 'setSource', + 'name' => 'setName', + 'description' => 'setDescription', + 'tags' => 'setTags', + 'trigger_condition' => 'setTriggerCondition', + 'required_tools' => 'setRequiredTools', + 'disable_model_invocation' => 'setDisableModelInvocation', + 'allowed_tools' => 'setAllowedTools', + 'installed_by' => 'setInstalledBy' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'source' => 'getSource', + 'name' => 'getName', + 'description' => 'getDescription', + 'tags' => 'getTags', + 'trigger_condition' => 'getTriggerCondition', + 'required_tools' => 'getRequiredTools', + 'disable_model_invocation' => 'getDisableModelInvocation', + 'allowed_tools' => 'getAllowedTools', + 'installed_by' => 'getInstalledBy' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('source', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('trigger_condition', $data ?? [], null); + $this->setIfExists('required_tools', $data ?? [], null); + $this->setIfExists('disable_model_invocation', $data ?? [], null); + $this->setIfExists('allowed_tools', $data ?? [], null); + $this->setIfExists('installed_by', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['source'] === null) { + $invalidProperties[] = "'source' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets source + * + * @return \QuantClient\Model\ImportSkillRequestSource + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param \QuantClient\Model\ImportSkillRequestSource $source source + * + * @return self + */ + public function setSource($source) + { + if (is_null($source)) { + throw new \InvalidArgumentException('non-nullable source cannot be null'); + } + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return self + */ + public function setTags($tags) + { + if (is_null($tags)) { + throw new \InvalidArgumentException('non-nullable tags cannot be null'); + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets trigger_condition + * + * @return string|null + */ + public function getTriggerCondition() + { + return $this->container['trigger_condition']; + } + + /** + * Sets trigger_condition + * + * @param string|null $trigger_condition trigger_condition + * + * @return self + */ + public function setTriggerCondition($trigger_condition) + { + if (is_null($trigger_condition)) { + throw new \InvalidArgumentException('non-nullable trigger_condition cannot be null'); + } + $this->container['trigger_condition'] = $trigger_condition; + + return $this; + } + + /** + * Gets required_tools + * + * @return string[]|null + */ + public function getRequiredTools() + { + return $this->container['required_tools']; + } + + /** + * Sets required_tools + * + * @param string[]|null $required_tools required_tools + * + * @return self + */ + public function setRequiredTools($required_tools) + { + if (is_null($required_tools)) { + throw new \InvalidArgumentException('non-nullable required_tools cannot be null'); + } + $this->container['required_tools'] = $required_tools; + + return $this; + } + + /** + * Gets disable_model_invocation + * + * @return bool|null + */ + public function getDisableModelInvocation() + { + return $this->container['disable_model_invocation']; + } + + /** + * Sets disable_model_invocation + * + * @param bool|null $disable_model_invocation disable_model_invocation + * + * @return self + */ + public function setDisableModelInvocation($disable_model_invocation) + { + if (is_null($disable_model_invocation)) { + throw new \InvalidArgumentException('non-nullable disable_model_invocation cannot be null'); + } + $this->container['disable_model_invocation'] = $disable_model_invocation; + + return $this; + } + + /** + * Gets allowed_tools + * + * @return string[]|null + */ + public function getAllowedTools() + { + return $this->container['allowed_tools']; + } + + /** + * Sets allowed_tools + * + * @param string[]|null $allowed_tools allowed_tools + * + * @return self + */ + public function setAllowedTools($allowed_tools) + { + if (is_null($allowed_tools)) { + throw new \InvalidArgumentException('non-nullable allowed_tools cannot be null'); + } + $this->container['allowed_tools'] = $allowed_tools; + + return $this; + } + + /** + * Gets installed_by + * + * @return string|null + */ + public function getInstalledBy() + { + return $this->container['installed_by']; + } + + /** + * Sets installed_by + * + * @param string|null $installed_by installed_by + * + * @return self + */ + public function setInstalledBy($installed_by) + { + if (is_null($installed_by)) { + throw new \InvalidArgumentException('non-nullable installed_by cannot be null'); + } + $this->container['installed_by'] = $installed_by; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ImportSkillRequestSource.php b/src/Model/ImportSkillRequestSource.php new file mode 100644 index 00000000..336ea1d1 --- /dev/null +++ b/src/Model/ImportSkillRequestSource.php @@ -0,0 +1,582 @@ + + */ +class ImportSkillRequestSource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'importSkill_request_source'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'url' => 'string', + 'repo' => 'string', + 'path' => 'string', + 'version' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'url' => null, + 'repo' => null, + 'path' => null, + 'version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'url' => false, + 'repo' => false, + 'path' => false, + 'version' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'url' => 'url', + 'repo' => 'repo', + 'path' => 'path', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'url' => 'setUrl', + 'repo' => 'setRepo', + 'path' => 'setPath', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'url' => 'getUrl', + 'repo' => 'getRepo', + 'path' => 'getPath', + 'version' => 'getVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_SKILLS_SH = 'skills.sh'; + public const TYPE_GITHUB = 'github'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_SKILLS_SH, + self::TYPE_GITHUB, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('repo', $data ?? [], null); + $this->setIfExists('path', $data ?? [], null); + $this->setIfExists('version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets repo + * + * @return string|null + */ + public function getRepo() + { + return $this->container['repo']; + } + + /** + * Sets repo + * + * @param string|null $repo repo + * + * @return self + */ + public function setRepo($repo) + { + if (is_null($repo)) { + throw new \InvalidArgumentException('non-nullable repo cannot be null'); + } + $this->container['repo'] = $repo; + + return $this; + } + + /** + * Gets path + * + * @return string|null + */ + public function getPath() + { + return $this->container['path']; + } + + /** + * Sets path + * + * @param string|null $path path + * + * @return self + */ + public function setPath($path) + { + if (is_null($path)) { + throw new \InvalidArgumentException('non-nullable path cannot be null'); + } + $this->container['path'] = $path; + + return $this; + } + + /** + * Gets version + * + * @return string|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param string|null $version version + * + * @return self + */ + public function setVersion($version) + { + if (is_null($version)) { + throw new \InvalidArgumentException('non-nullable version cannot be null'); + } + $this->container['version'] = $version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/KVItemsCreate200Response.php b/src/Model/KVItemsCreate200Response.php index fe20bc82..83343fb5 100644 --- a/src/Model/KVItemsCreate200Response.php +++ b/src/Model/KVItemsCreate200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/KVItemsDelete200Response.php b/src/Model/KVItemsDelete200Response.php index 22e33136..f9f4cbb1 100644 --- a/src/Model/KVItemsDelete200Response.php +++ b/src/Model/KVItemsDelete200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/KVItemsShow200Response.php b/src/Model/KVItemsShow200Response.php index 9fe600ff..8ff72d54 100644 --- a/src/Model/KVItemsShow200Response.php +++ b/src/Model/KVItemsShow200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/KVItemsShow200ResponseValue.php b/src/Model/KVItemsShow200ResponseValue.php index 3b567d4e..d1aa6095 100644 --- a/src/Model/KVItemsShow200ResponseValue.php +++ b/src/Model/KVItemsShow200ResponseValue.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/KVLinkToProject200Response.php b/src/Model/KVLinkToProject200Response.php new file mode 100644 index 00000000..b4faff11 --- /dev/null +++ b/src/Model/KVLinkToProject200Response.php @@ -0,0 +1,443 @@ + + */ +class KVLinkToProject200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'KV_link_to_project_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'success' => 'bool', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'success' => false, + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('success', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success) + { + if (is_null($success)) { + throw new \InvalidArgumentException('non-nullable success cannot be null'); + } + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/KVLinkToProjectRequest.php b/src/Model/KVLinkToProjectRequest.php new file mode 100644 index 00000000..79986d75 --- /dev/null +++ b/src/Model/KVLinkToProjectRequest.php @@ -0,0 +1,412 @@ + + */ +class KVLinkToProjectRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'KV_link_to_project_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'project_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'project_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'project_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'project_id' => 'project_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'project_id' => 'setProjectId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'project_id' => 'getProjectId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('project_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['project_id'] === null) { + $invalidProperties[] = "'project_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets project_id + * + * @return int + */ + public function getProjectId() + { + return $this->container['project_id']; + } + + /** + * Sets project_id + * + * @param int $project_id Target project ID to link to + * + * @return self + */ + public function setProjectId($project_id) + { + if (is_null($project_id)) { + throw new \InvalidArgumentException('non-nullable project_id cannot be null'); + } + $this->container['project_id'] = $project_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ListAIAgents200Response.php b/src/Model/ListAIAgents200Response.php index e84db055..7b78fe10 100644 --- a/src/Model/ListAIAgents200Response.php +++ b/src/Model/ListAIAgents200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListAIAgents200ResponseAgentsInner.php b/src/Model/ListAIAgents200ResponseAgentsInner.php index 108a185d..bf0cbd5c 100644 --- a/src/Model/ListAIAgents200ResponseAgentsInner.php +++ b/src/Model/ListAIAgents200ResponseAgentsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -65,6 +65,11 @@ class ListAIAgents200ResponseAgentsInner implements ModelInterface, ArrayAccess, 'temperature' => 'float', 'max_tokens' => 'int', 'allowed_tools' => 'string[]', + 'assigned_skills' => 'string[]', + 'long_context' => 'bool', + 'guardrail_preset' => 'string', + 'is_global' => 'bool', + 'has_overlay' => 'bool', 'created_at' => '\DateTime', 'updated_at' => '\DateTime' ]; @@ -85,6 +90,11 @@ class ListAIAgents200ResponseAgentsInner implements ModelInterface, ArrayAccess, 'temperature' => null, 'max_tokens' => null, 'allowed_tools' => null, + 'assigned_skills' => null, + 'long_context' => null, + 'guardrail_preset' => null, + 'is_global' => null, + 'has_overlay' => null, 'created_at' => 'date-time', 'updated_at' => 'date-time' ]; @@ -103,6 +113,11 @@ class ListAIAgents200ResponseAgentsInner implements ModelInterface, ArrayAccess, 'temperature' => false, 'max_tokens' => false, 'allowed_tools' => false, + 'assigned_skills' => false, + 'long_context' => false, + 'guardrail_preset' => false, + 'is_global' => false, + 'has_overlay' => false, 'created_at' => false, 'updated_at' => false ]; @@ -201,6 +216,11 @@ public function isNullableSetToNull(string $property): bool 'temperature' => 'temperature', 'max_tokens' => 'maxTokens', 'allowed_tools' => 'allowedTools', + 'assigned_skills' => 'assignedSkills', + 'long_context' => 'longContext', + 'guardrail_preset' => 'guardrailPreset', + 'is_global' => 'isGlobal', + 'has_overlay' => 'hasOverlay', 'created_at' => 'createdAt', 'updated_at' => 'updatedAt' ]; @@ -219,6 +239,11 @@ public function isNullableSetToNull(string $property): bool 'temperature' => 'setTemperature', 'max_tokens' => 'setMaxTokens', 'allowed_tools' => 'setAllowedTools', + 'assigned_skills' => 'setAssignedSkills', + 'long_context' => 'setLongContext', + 'guardrail_preset' => 'setGuardrailPreset', + 'is_global' => 'setIsGlobal', + 'has_overlay' => 'setHasOverlay', 'created_at' => 'setCreatedAt', 'updated_at' => 'setUpdatedAt' ]; @@ -237,6 +262,11 @@ public function isNullableSetToNull(string $property): bool 'temperature' => 'getTemperature', 'max_tokens' => 'getMaxTokens', 'allowed_tools' => 'getAllowedTools', + 'assigned_skills' => 'getAssignedSkills', + 'long_context' => 'getLongContext', + 'guardrail_preset' => 'getGuardrailPreset', + 'is_global' => 'getIsGlobal', + 'has_overlay' => 'getHasOverlay', 'created_at' => 'getCreatedAt', 'updated_at' => 'getUpdatedAt' ]; @@ -306,6 +336,11 @@ public function __construct(?array $data = null) $this->setIfExists('temperature', $data ?? [], null); $this->setIfExists('max_tokens', $data ?? [], null); $this->setIfExists('allowed_tools', $data ?? [], null); + $this->setIfExists('assigned_skills', $data ?? [], null); + $this->setIfExists('long_context', $data ?? [], null); + $this->setIfExists('guardrail_preset', $data ?? [], null); + $this->setIfExists('is_global', $data ?? [], null); + $this->setIfExists('has_overlay', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); } @@ -568,6 +603,141 @@ public function setAllowedTools($allowed_tools) return $this; } + /** + * Gets assigned_skills + * + * @return string[]|null + */ + public function getAssignedSkills() + { + return $this->container['assigned_skills']; + } + + /** + * Sets assigned_skills + * + * @param string[]|null $assigned_skills assigned_skills + * + * @return self + */ + public function setAssignedSkills($assigned_skills) + { + if (is_null($assigned_skills)) { + throw new \InvalidArgumentException('non-nullable assigned_skills cannot be null'); + } + $this->container['assigned_skills'] = $assigned_skills; + + return $this; + } + + /** + * Gets long_context + * + * @return bool|null + */ + public function getLongContext() + { + return $this->container['long_context']; + } + + /** + * Sets long_context + * + * @param bool|null $long_context long_context + * + * @return self + */ + public function setLongContext($long_context) + { + if (is_null($long_context)) { + throw new \InvalidArgumentException('non-nullable long_context cannot be null'); + } + $this->container['long_context'] = $long_context; + + return $this; + } + + /** + * Gets guardrail_preset + * + * @return string|null + */ + public function getGuardrailPreset() + { + return $this->container['guardrail_preset']; + } + + /** + * Sets guardrail_preset + * + * @param string|null $guardrail_preset guardrail_preset + * + * @return self + */ + public function setGuardrailPreset($guardrail_preset) + { + if (is_null($guardrail_preset)) { + throw new \InvalidArgumentException('non-nullable guardrail_preset cannot be null'); + } + $this->container['guardrail_preset'] = $guardrail_preset; + + return $this; + } + + /** + * Gets is_global + * + * @return bool|null + */ + public function getIsGlobal() + { + return $this->container['is_global']; + } + + /** + * Sets is_global + * + * @param bool|null $is_global is_global + * + * @return self + */ + public function setIsGlobal($is_global) + { + if (is_null($is_global)) { + throw new \InvalidArgumentException('non-nullable is_global cannot be null'); + } + $this->container['is_global'] = $is_global; + + return $this; + } + + /** + * Gets has_overlay + * + * @return bool|null + */ + public function getHasOverlay() + { + return $this->container['has_overlay']; + } + + /** + * Sets has_overlay + * + * @param bool|null $has_overlay has_overlay + * + * @return self + */ + public function setHasOverlay($has_overlay) + { + if (is_null($has_overlay)) { + throw new \InvalidArgumentException('non-nullable has_overlay cannot be null'); + } + $this->container['has_overlay'] = $has_overlay; + + return $this; + } + /** * Gets created_at * diff --git a/src/Model/ListAIModels200Response.php b/src/Model/ListAIModels200Response.php index 1bd9c5ba..442624f7 100644 --- a/src/Model/ListAIModels200Response.php +++ b/src/Model/ListAIModels200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListAIModels200ResponseModelsInner.php b/src/Model/ListAIModels200ResponseModelsInner.php index c072856c..6b5edfdf 100644 --- a/src/Model/ListAIModels200ResponseModelsInner.php +++ b/src/Model/ListAIModels200ResponseModelsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListAIModels200ResponseModelsInnerCapabilities.php b/src/Model/ListAIModels200ResponseModelsInnerCapabilities.php index 11181f27..d3925f27 100644 --- a/src/Model/ListAIModels200ResponseModelsInnerCapabilities.php +++ b/src/Model/ListAIModels200ResponseModelsInnerCapabilities.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListAISessions200ResponseInner.php b/src/Model/ListAISessions200ResponseInner.php index 0688794e..d84f98a8 100644 --- a/src/Model/ListAISessions200ResponseInner.php +++ b/src/Model/ListAISessions200ResponseInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListAIToolExecutions200Response.php b/src/Model/ListAIToolExecutions200Response.php index c85201f8..3fd544ea 100644 --- a/src/Model/ListAIToolExecutions200Response.php +++ b/src/Model/ListAIToolExecutions200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListAIToolExecutions200ResponseExecutionsInner.php b/src/Model/ListAIToolExecutions200ResponseExecutionsInner.php index d35f3d98..33a93fbb 100644 --- a/src/Model/ListAIToolExecutions200ResponseExecutionsInner.php +++ b/src/Model/ListAIToolExecutions200ResponseExecutionsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListAIToolNames200Response.php b/src/Model/ListAIToolNames200Response.php index 08c4bff5..25751a7d 100644 --- a/src/Model/ListAIToolNames200Response.php +++ b/src/Model/ListAIToolNames200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListAITools200Response.php b/src/Model/ListAITools200Response.php index 30a4a554..aa922162 100644 --- a/src/Model/ListAITools200Response.php +++ b/src/Model/ListAITools200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListAITools200ResponseToolsInner.php b/src/Model/ListAITools200ResponseToolsInner.php index 1e894f30..e51a4429 100644 --- a/src/Model/ListAITools200ResponseToolsInner.php +++ b/src/Model/ListAITools200ResponseToolsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListAITools200ResponseToolsInnerToolSpec.php b/src/Model/ListAITools200ResponseToolsInnerToolSpec.php index fcd955e1..4ce18609 100644 --- a/src/Model/ListAITools200ResponseToolsInnerToolSpec.php +++ b/src/Model/ListAITools200ResponseToolsInnerToolSpec.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListAITools200ResponseToolsInnerToolSpecInputSchema.php b/src/Model/ListAITools200ResponseToolsInnerToolSpecInputSchema.php index ee889591..a1587757 100644 --- a/src/Model/ListAITools200ResponseToolsInnerToolSpecInputSchema.php +++ b/src/Model/ListAITools200ResponseToolsInnerToolSpecInputSchema.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListBackups200Response.php b/src/Model/ListBackups200Response.php index 67caeacf..436a942e 100644 --- a/src/Model/ListBackups200Response.php +++ b/src/Model/ListBackups200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListBackups200ResponseBackupsInner.php b/src/Model/ListBackups200ResponseBackupsInner.php index ccfe8618..5e404cc9 100644 --- a/src/Model/ListBackups200ResponseBackupsInner.php +++ b/src/Model/ListBackups200ResponseBackupsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListBackups422Response.php b/src/Model/ListBackups422Response.php index 8fd6fd46..d3e52026 100644 --- a/src/Model/ListBackups422Response.php +++ b/src/Model/ListBackups422Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListCustomTools200Response.php b/src/Model/ListCustomTools200Response.php index 01c3455b..7713e01d 100644 --- a/src/Model/ListCustomTools200Response.php +++ b/src/Model/ListCustomTools200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListCustomTools200ResponseToolsInner.php b/src/Model/ListCustomTools200ResponseToolsInner.php index 7c513285..14bc7d9d 100644 --- a/src/Model/ListCustomTools200ResponseToolsInner.php +++ b/src/Model/ListCustomTools200ResponseToolsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -61,7 +61,7 @@ class ListCustomTools200ResponseToolsInner implements ModelInterface, ArrayAcces 'description' => 'string', 'edge_function_url' => 'string', 'is_async' => 'bool', - 'input_schema' => 'object', + 'input_schema' => 'string', 'created_at' => '\DateTime' ]; @@ -435,7 +435,7 @@ public function setIsAsync($is_async) /** * Gets input_schema * - * @return object|null + * @return string|null */ public function getInputSchema() { @@ -445,7 +445,7 @@ public function getInputSchema() /** * Sets input_schema * - * @param object|null $input_schema input_schema + * @param string|null $input_schema input_schema * * @return self */ diff --git a/src/Model/ListFiles200Response.php b/src/Model/ListFiles200Response.php index eec2b386..966e7305 100644 --- a/src/Model/ListFiles200Response.php +++ b/src/Model/ListFiles200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListFiles200ResponseFilesInner.php b/src/Model/ListFiles200ResponseFilesInner.php index 33c88ff9..bc68aded 100644 --- a/src/Model/ListFiles200ResponseFilesInner.php +++ b/src/Model/ListFiles200ResponseFilesInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListOrchestrationBatches200Response.php b/src/Model/ListOrchestrationBatches200Response.php new file mode 100644 index 00000000..5d4df088 --- /dev/null +++ b/src/Model/ListOrchestrationBatches200Response.php @@ -0,0 +1,450 @@ + + */ +class ListOrchestrationBatches200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'listOrchestrationBatches_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'batches' => '\QuantClient\Model\ListOrchestrationBatches200ResponseBatchesInner[]', + 'next_cursor' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'batches' => null, + 'next_cursor' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'batches' => false, + 'next_cursor' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'batches' => 'batches', + 'next_cursor' => 'nextCursor' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'batches' => 'setBatches', + 'next_cursor' => 'setNextCursor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'batches' => 'getBatches', + 'next_cursor' => 'getNextCursor' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('batches', $data ?? [], null); + $this->setIfExists('next_cursor', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets batches + * + * @return \QuantClient\Model\ListOrchestrationBatches200ResponseBatchesInner[]|null + */ + public function getBatches() + { + return $this->container['batches']; + } + + /** + * Sets batches + * + * @param \QuantClient\Model\ListOrchestrationBatches200ResponseBatchesInner[]|null $batches batches + * + * @return self + */ + public function setBatches($batches) + { + if (is_null($batches)) { + throw new \InvalidArgumentException('non-nullable batches cannot be null'); + } + $this->container['batches'] = $batches; + + return $this; + } + + /** + * Gets next_cursor + * + * @return string|null + */ + public function getNextCursor() + { + return $this->container['next_cursor']; + } + + /** + * Sets next_cursor + * + * @param string|null $next_cursor next_cursor + * + * @return self + */ + public function setNextCursor($next_cursor) + { + if (is_null($next_cursor)) { + array_push($this->openAPINullablesSetToNull, 'next_cursor'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('next_cursor', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['next_cursor'] = $next_cursor; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ListOrchestrationBatches200ResponseBatchesInner.php b/src/Model/ListOrchestrationBatches200ResponseBatchesInner.php new file mode 100644 index 00000000..799837ee --- /dev/null +++ b/src/Model/ListOrchestrationBatches200ResponseBatchesInner.php @@ -0,0 +1,760 @@ + + */ +class ListOrchestrationBatches200ResponseBatchesInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'listOrchestrationBatches_200_response_batches_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'batch_id' => 'string', + 'orchestration_id' => 'string', + 'iteration' => 'int', + 'item_count' => 'int', + 'completed_count' => 'int', + 'failed_count' => 'int', + 'status' => 'string', + 'started_at' => '\DateTime', + 'completed_at' => '\DateTime', + 'error' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'batch_id' => null, + 'orchestration_id' => null, + 'iteration' => null, + 'item_count' => null, + 'completed_count' => null, + 'failed_count' => null, + 'status' => null, + 'started_at' => 'date-time', + 'completed_at' => 'date-time', + 'error' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'batch_id' => false, + 'orchestration_id' => false, + 'iteration' => false, + 'item_count' => false, + 'completed_count' => false, + 'failed_count' => false, + 'status' => false, + 'started_at' => false, + 'completed_at' => false, + 'error' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'batch_id' => 'batchId', + 'orchestration_id' => 'orchestrationId', + 'iteration' => 'iteration', + 'item_count' => 'itemCount', + 'completed_count' => 'completedCount', + 'failed_count' => 'failedCount', + 'status' => 'status', + 'started_at' => 'startedAt', + 'completed_at' => 'completedAt', + 'error' => 'error' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'batch_id' => 'setBatchId', + 'orchestration_id' => 'setOrchestrationId', + 'iteration' => 'setIteration', + 'item_count' => 'setItemCount', + 'completed_count' => 'setCompletedCount', + 'failed_count' => 'setFailedCount', + 'status' => 'setStatus', + 'started_at' => 'setStartedAt', + 'completed_at' => 'setCompletedAt', + 'error' => 'setError' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'batch_id' => 'getBatchId', + 'orchestration_id' => 'getOrchestrationId', + 'iteration' => 'getIteration', + 'item_count' => 'getItemCount', + 'completed_count' => 'getCompletedCount', + 'failed_count' => 'getFailedCount', + 'status' => 'getStatus', + 'started_at' => 'getStartedAt', + 'completed_at' => 'getCompletedAt', + 'error' => 'getError' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_PENDING = 'pending'; + public const STATUS_RUNNING = 'running'; + public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_PENDING, + self::STATUS_RUNNING, + self::STATUS_COMPLETED, + self::STATUS_FAILED, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('batch_id', $data ?? [], null); + $this->setIfExists('orchestration_id', $data ?? [], null); + $this->setIfExists('iteration', $data ?? [], null); + $this->setIfExists('item_count', $data ?? [], null); + $this->setIfExists('completed_count', $data ?? [], null); + $this->setIfExists('failed_count', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('started_at', $data ?? [], null); + $this->setIfExists('completed_at', $data ?? [], null); + $this->setIfExists('error', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets batch_id + * + * @return string|null + */ + public function getBatchId() + { + return $this->container['batch_id']; + } + + /** + * Sets batch_id + * + * @param string|null $batch_id batch_id + * + * @return self + */ + public function setBatchId($batch_id) + { + if (is_null($batch_id)) { + throw new \InvalidArgumentException('non-nullable batch_id cannot be null'); + } + $this->container['batch_id'] = $batch_id; + + return $this; + } + + /** + * Gets orchestration_id + * + * @return string|null + */ + public function getOrchestrationId() + { + return $this->container['orchestration_id']; + } + + /** + * Sets orchestration_id + * + * @param string|null $orchestration_id orchestration_id + * + * @return self + */ + public function setOrchestrationId($orchestration_id) + { + if (is_null($orchestration_id)) { + throw new \InvalidArgumentException('non-nullable orchestration_id cannot be null'); + } + $this->container['orchestration_id'] = $orchestration_id; + + return $this; + } + + /** + * Gets iteration + * + * @return int|null + */ + public function getIteration() + { + return $this->container['iteration']; + } + + /** + * Sets iteration + * + * @param int|null $iteration iteration + * + * @return self + */ + public function setIteration($iteration) + { + if (is_null($iteration)) { + throw new \InvalidArgumentException('non-nullable iteration cannot be null'); + } + $this->container['iteration'] = $iteration; + + return $this; + } + + /** + * Gets item_count + * + * @return int|null + */ + public function getItemCount() + { + return $this->container['item_count']; + } + + /** + * Sets item_count + * + * @param int|null $item_count item_count + * + * @return self + */ + public function setItemCount($item_count) + { + if (is_null($item_count)) { + throw new \InvalidArgumentException('non-nullable item_count cannot be null'); + } + $this->container['item_count'] = $item_count; + + return $this; + } + + /** + * Gets completed_count + * + * @return int|null + */ + public function getCompletedCount() + { + return $this->container['completed_count']; + } + + /** + * Sets completed_count + * + * @param int|null $completed_count completed_count + * + * @return self + */ + public function setCompletedCount($completed_count) + { + if (is_null($completed_count)) { + throw new \InvalidArgumentException('non-nullable completed_count cannot be null'); + } + $this->container['completed_count'] = $completed_count; + + return $this; + } + + /** + * Gets failed_count + * + * @return int|null + */ + public function getFailedCount() + { + return $this->container['failed_count']; + } + + /** + * Sets failed_count + * + * @param int|null $failed_count failed_count + * + * @return self + */ + public function setFailedCount($failed_count) + { + if (is_null($failed_count)) { + throw new \InvalidArgumentException('non-nullable failed_count cannot be null'); + } + $this->container['failed_count'] = $failed_count; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets started_at + * + * @return \DateTime|null + */ + public function getStartedAt() + { + return $this->container['started_at']; + } + + /** + * Sets started_at + * + * @param \DateTime|null $started_at started_at + * + * @return self + */ + public function setStartedAt($started_at) + { + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + } + $this->container['started_at'] = $started_at; + + return $this; + } + + /** + * Gets completed_at + * + * @return \DateTime|null + */ + public function getCompletedAt() + { + return $this->container['completed_at']; + } + + /** + * Sets completed_at + * + * @param \DateTime|null $completed_at completed_at + * + * @return self + */ + public function setCompletedAt($completed_at) + { + if (is_null($completed_at)) { + throw new \InvalidArgumentException('non-nullable completed_at cannot be null'); + } + $this->container['completed_at'] = $completed_at; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error error + * + * @return self + */ + public function setError($error) + { + if (is_null($error)) { + array_push($this->openAPINullablesSetToNull, 'error'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('error', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['error'] = $error; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ListOrchestrations200Response.php b/src/Model/ListOrchestrations200Response.php new file mode 100644 index 00000000..5a8cc80e --- /dev/null +++ b/src/Model/ListOrchestrations200Response.php @@ -0,0 +1,450 @@ + + */ +class ListOrchestrations200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'listOrchestrations_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'orchestrations' => 'object[]', + 'next_cursor' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'orchestrations' => null, + 'next_cursor' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'orchestrations' => false, + 'next_cursor' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'orchestrations' => 'orchestrations', + 'next_cursor' => 'nextCursor' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'orchestrations' => 'setOrchestrations', + 'next_cursor' => 'setNextCursor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'orchestrations' => 'getOrchestrations', + 'next_cursor' => 'getNextCursor' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('orchestrations', $data ?? [], null); + $this->setIfExists('next_cursor', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets orchestrations + * + * @return object[]|null + */ + public function getOrchestrations() + { + return $this->container['orchestrations']; + } + + /** + * Sets orchestrations + * + * @param object[]|null $orchestrations orchestrations + * + * @return self + */ + public function setOrchestrations($orchestrations) + { + if (is_null($orchestrations)) { + throw new \InvalidArgumentException('non-nullable orchestrations cannot be null'); + } + $this->container['orchestrations'] = $orchestrations; + + return $this; + } + + /** + * Gets next_cursor + * + * @return string|null + */ + public function getNextCursor() + { + return $this->container['next_cursor']; + } + + /** + * Sets next_cursor + * + * @param string|null $next_cursor next_cursor + * + * @return self + */ + public function setNextCursor($next_cursor) + { + if (is_null($next_cursor)) { + array_push($this->openAPINullablesSetToNull, 'next_cursor'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('next_cursor', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['next_cursor'] = $next_cursor; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ListSkillCollections200Response.php b/src/Model/ListSkillCollections200Response.php new file mode 100644 index 00000000..ca3e3b44 --- /dev/null +++ b/src/Model/ListSkillCollections200Response.php @@ -0,0 +1,409 @@ + + */ +class ListSkillCollections200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'listSkillCollections_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'collections' => '\QuantClient\Model\ListSkillCollections200ResponseCollectionsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'collections' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'collections' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'collections' => 'collections' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'collections' => 'setCollections' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'collections' => 'getCollections' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('collections', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets collections + * + * @return \QuantClient\Model\ListSkillCollections200ResponseCollectionsInner[]|null + */ + public function getCollections() + { + return $this->container['collections']; + } + + /** + * Sets collections + * + * @param \QuantClient\Model\ListSkillCollections200ResponseCollectionsInner[]|null $collections collections + * + * @return self + */ + public function setCollections($collections) + { + if (is_null($collections)) { + throw new \InvalidArgumentException('non-nullable collections cannot be null'); + } + $this->container['collections'] = $collections; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ListSkillCollections200ResponseCollectionsInner.php b/src/Model/ListSkillCollections200ResponseCollectionsInner.php new file mode 100644 index 00000000..91352a05 --- /dev/null +++ b/src/Model/ListSkillCollections200ResponseCollectionsInner.php @@ -0,0 +1,477 @@ + + */ +class ListSkillCollections200ResponseCollectionsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'listSkillCollections_200_response_collections_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'namespace' => 'string', + 'count' => 'int', + 'skills' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'namespace' => null, + 'count' => null, + 'skills' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'namespace' => false, + 'count' => false, + 'skills' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'namespace' => 'namespace', + 'count' => 'count', + 'skills' => 'skills' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'namespace' => 'setNamespace', + 'count' => 'setCount', + 'skills' => 'setSkills' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'namespace' => 'getNamespace', + 'count' => 'getCount', + 'skills' => 'getSkills' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('namespace', $data ?? [], null); + $this->setIfExists('count', $data ?? [], null); + $this->setIfExists('skills', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets namespace + * + * @return string|null + */ + public function getNamespace() + { + return $this->container['namespace']; + } + + /** + * Sets namespace + * + * @param string|null $namespace namespace + * + * @return self + */ + public function setNamespace($namespace) + { + if (is_null($namespace)) { + throw new \InvalidArgumentException('non-nullable namespace cannot be null'); + } + $this->container['namespace'] = $namespace; + + return $this; + } + + /** + * Gets count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count count + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets skills + * + * @return string[]|null + */ + public function getSkills() + { + return $this->container['skills']; + } + + /** + * Sets skills + * + * @param string[]|null $skills skills + * + * @return self + */ + public function setSkills($skills) + { + if (is_null($skills)) { + throw new \InvalidArgumentException('non-nullable skills cannot be null'); + } + $this->container['skills'] = $skills; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetAIUsageStats200ResponseByModelValue.php b/src/Model/ListSkills200Response.php similarity index 84% rename from src/Model/GetAIUsageStats200ResponseByModelValue.php rename to src/Model/ListSkills200Response.php index 1723dac2..5e942ab5 100644 --- a/src/Model/GetAIUsageStats200ResponseByModelValue.php +++ b/src/Model/ListSkills200Response.php @@ -1,6 +1,6 @@ */ -class GetAIUsageStats200ResponseByModelValue implements ModelInterface, ArrayAccess, \JsonSerializable +class ListSkills200Response implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class GetAIUsageStats200ResponseByModelValue implements ModelInterface, ArrayAcc * * @var string */ - protected static $openAPIModelName = 'getAIUsageStats_200_response_by_model_value'; + protected static $openAPIModelName = 'listSkills_200_response'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,8 +57,8 @@ class GetAIUsageStats200ResponseByModelValue implements ModelInterface, ArrayAcc * @var string[] */ protected static $openAPITypes = [ - 'requests' => 'int', - 'tokens' => 'int' + 'skills' => '\QuantClient\Model\ListSkills200ResponseSkillsInner[]', + 'count' => 'int' ]; /** @@ -69,8 +69,8 @@ class GetAIUsageStats200ResponseByModelValue implements ModelInterface, ArrayAcc * @psalm-var array */ protected static $openAPIFormats = [ - 'requests' => null, - 'tokens' => null + 'skills' => null, + 'count' => null ]; /** @@ -79,8 +79,8 @@ class GetAIUsageStats200ResponseByModelValue implements ModelInterface, ArrayAcc * @var boolean[] */ protected static array $openAPINullables = [ - 'requests' => false, - 'tokens' => false + 'skills' => false, + 'count' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'requests' => 'requests', - 'tokens' => 'tokens' + 'skills' => 'skills', + 'count' => 'count' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'requests' => 'setRequests', - 'tokens' => 'setTokens' + 'skills' => 'setSkills', + 'count' => 'setCount' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'requests' => 'getRequests', - 'tokens' => 'getTokens' + 'skills' => 'getSkills', + 'count' => 'getCount' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('requests', $data ?? [], null); - $this->setIfExists('tokens', $data ?? [], null); + $this->setIfExists('skills', $data ?? [], null); + $this->setIfExists('count', $data ?? [], null); } /** @@ -297,55 +297,55 @@ public function valid() /** - * Gets requests + * Gets skills * - * @return int|null + * @return \QuantClient\Model\ListSkills200ResponseSkillsInner[]|null */ - public function getRequests() + public function getSkills() { - return $this->container['requests']; + return $this->container['skills']; } /** - * Sets requests + * Sets skills * - * @param int|null $requests Number of requests for this model + * @param \QuantClient\Model\ListSkills200ResponseSkillsInner[]|null $skills skills * * @return self */ - public function setRequests($requests) + public function setSkills($skills) { - if (is_null($requests)) { - throw new \InvalidArgumentException('non-nullable requests cannot be null'); + if (is_null($skills)) { + throw new \InvalidArgumentException('non-nullable skills cannot be null'); } - $this->container['requests'] = $requests; + $this->container['skills'] = $skills; return $this; } /** - * Gets tokens + * Gets count * * @return int|null */ - public function getTokens() + public function getCount() { - return $this->container['tokens']; + return $this->container['count']; } /** - * Sets tokens + * Sets count * - * @param int|null $tokens Total tokens for this model + * @param int|null $count count * * @return self */ - public function setTokens($tokens) + public function setCount($count) { - if (is_null($tokens)) { - throw new \InvalidArgumentException('non-nullable tokens cannot be null'); + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); } - $this->container['tokens'] = $tokens; + $this->container['count'] = $count; return $this; } diff --git a/src/Model/ListSkills200ResponseSkillsInner.php b/src/Model/ListSkills200ResponseSkillsInner.php new file mode 100644 index 00000000..b4e56343 --- /dev/null +++ b/src/Model/ListSkills200ResponseSkillsInner.php @@ -0,0 +1,681 @@ + + */ +class ListSkills200ResponseSkillsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'listSkills_200_response_skills_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'skill_id' => 'string', + 'name' => 'string', + 'description' => 'string', + 'tags' => 'string[]', + 'source' => 'object', + 'trigger_condition' => 'string', + 'namespace' => 'string', + 'installed_at' => '\DateTime', + 'updated_at' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'skill_id' => null, + 'name' => null, + 'description' => null, + 'tags' => null, + 'source' => null, + 'trigger_condition' => null, + 'namespace' => null, + 'installed_at' => 'date-time', + 'updated_at' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'skill_id' => false, + 'name' => false, + 'description' => false, + 'tags' => false, + 'source' => false, + 'trigger_condition' => false, + 'namespace' => false, + 'installed_at' => false, + 'updated_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'skill_id' => 'skillId', + 'name' => 'name', + 'description' => 'description', + 'tags' => 'tags', + 'source' => 'source', + 'trigger_condition' => 'triggerCondition', + 'namespace' => 'namespace', + 'installed_at' => 'installedAt', + 'updated_at' => 'updatedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'skill_id' => 'setSkillId', + 'name' => 'setName', + 'description' => 'setDescription', + 'tags' => 'setTags', + 'source' => 'setSource', + 'trigger_condition' => 'setTriggerCondition', + 'namespace' => 'setNamespace', + 'installed_at' => 'setInstalledAt', + 'updated_at' => 'setUpdatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'skill_id' => 'getSkillId', + 'name' => 'getName', + 'description' => 'getDescription', + 'tags' => 'getTags', + 'source' => 'getSource', + 'trigger_condition' => 'getTriggerCondition', + 'namespace' => 'getNamespace', + 'installed_at' => 'getInstalledAt', + 'updated_at' => 'getUpdatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('skill_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('source', $data ?? [], null); + $this->setIfExists('trigger_condition', $data ?? [], null); + $this->setIfExists('namespace', $data ?? [], null); + $this->setIfExists('installed_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets skill_id + * + * @return string|null + */ + public function getSkillId() + { + return $this->container['skill_id']; + } + + /** + * Sets skill_id + * + * @param string|null $skill_id skill_id + * + * @return self + */ + public function setSkillId($skill_id) + { + if (is_null($skill_id)) { + throw new \InvalidArgumentException('non-nullable skill_id cannot be null'); + } + $this->container['skill_id'] = $skill_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return self + */ + public function setTags($tags) + { + if (is_null($tags)) { + throw new \InvalidArgumentException('non-nullable tags cannot be null'); + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets source + * + * @return object|null + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param object|null $source source + * + * @return self + */ + public function setSource($source) + { + if (is_null($source)) { + throw new \InvalidArgumentException('non-nullable source cannot be null'); + } + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets trigger_condition + * + * @return string|null + */ + public function getTriggerCondition() + { + return $this->container['trigger_condition']; + } + + /** + * Sets trigger_condition + * + * @param string|null $trigger_condition trigger_condition + * + * @return self + */ + public function setTriggerCondition($trigger_condition) + { + if (is_null($trigger_condition)) { + throw new \InvalidArgumentException('non-nullable trigger_condition cannot be null'); + } + $this->container['trigger_condition'] = $trigger_condition; + + return $this; + } + + /** + * Gets namespace + * + * @return string|null + */ + public function getNamespace() + { + return $this->container['namespace']; + } + + /** + * Sets namespace + * + * @param string|null $namespace namespace + * + * @return self + */ + public function setNamespace($namespace) + { + if (is_null($namespace)) { + throw new \InvalidArgumentException('non-nullable namespace cannot be null'); + } + $this->container['namespace'] = $namespace; + + return $this; + } + + /** + * Gets installed_at + * + * @return \DateTime|null + */ + public function getInstalledAt() + { + return $this->container['installed_at']; + } + + /** + * Sets installed_at + * + * @param \DateTime|null $installed_at installed_at + * + * @return self + */ + public function setInstalledAt($installed_at) + { + if (is_null($installed_at)) { + throw new \InvalidArgumentException('non-nullable installed_at cannot be null'); + } + $this->container['installed_at'] = $installed_at; + + return $this; + } + + /** + * Gets updated_at + * + * @return \DateTime|null + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param \DateTime|null $updated_at updated_at + * + * @return self + */ + public function setUpdatedAt($updated_at) + { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } + $this->container['updated_at'] = $updated_at; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ListSlackBots200Response.php b/src/Model/ListSlackBots200Response.php new file mode 100644 index 00000000..a27a9d07 --- /dev/null +++ b/src/Model/ListSlackBots200Response.php @@ -0,0 +1,409 @@ + + */ +class ListSlackBots200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'listSlackBots_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bots' => '\QuantClient\Model\ListSlackBots200ResponseBotsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bots' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'bots' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'bots' => 'bots' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bots' => 'setBots' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bots' => 'getBots' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('bots', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bots + * + * @return \QuantClient\Model\ListSlackBots200ResponseBotsInner[]|null + */ + public function getBots() + { + return $this->container['bots']; + } + + /** + * Sets bots + * + * @param \QuantClient\Model\ListSlackBots200ResponseBotsInner[]|null $bots bots + * + * @return self + */ + public function setBots($bots) + { + if (is_null($bots)) { + throw new \InvalidArgumentException('non-nullable bots cannot be null'); + } + $this->container['bots'] = $bots; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ListSlackBots200ResponseBotsInner.php b/src/Model/ListSlackBots200ResponseBotsInner.php new file mode 100644 index 00000000..04405287 --- /dev/null +++ b/src/Model/ListSlackBots200ResponseBotsInner.php @@ -0,0 +1,1089 @@ + + */ +class ListSlackBots200ResponseBotsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'listSlackBots_200_response_bots_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bot_id' => 'string', + 'name' => 'string', + 'setup_type' => 'string', + 'status' => 'string', + 'connected' => 'bool', + 'system_prompt' => 'string', + 'model_id' => 'string', + 'temperature' => 'float', + 'max_tokens' => 'int', + 'allowed_tools' => 'string[]', + 'assigned_skills' => 'string[]', + 'allowed_collections' => 'string[]', + 'allowed_sub_agents' => 'string[]', + 'guardrail_preset' => 'string', + 'filter_policies' => 'string[]', + 'long_context' => 'bool', + 'session_ttl_days' => 'int', + 'keywords_enabled' => 'bool', + 'created_at' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bot_id' => null, + 'name' => null, + 'setup_type' => null, + 'status' => null, + 'connected' => null, + 'system_prompt' => null, + 'model_id' => null, + 'temperature' => null, + 'max_tokens' => null, + 'allowed_tools' => null, + 'assigned_skills' => null, + 'allowed_collections' => null, + 'allowed_sub_agents' => null, + 'guardrail_preset' => null, + 'filter_policies' => null, + 'long_context' => null, + 'session_ttl_days' => null, + 'keywords_enabled' => null, + 'created_at' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'bot_id' => false, + 'name' => false, + 'setup_type' => false, + 'status' => false, + 'connected' => false, + 'system_prompt' => false, + 'model_id' => false, + 'temperature' => false, + 'max_tokens' => false, + 'allowed_tools' => false, + 'assigned_skills' => false, + 'allowed_collections' => false, + 'allowed_sub_agents' => false, + 'guardrail_preset' => false, + 'filter_policies' => false, + 'long_context' => false, + 'session_ttl_days' => false, + 'keywords_enabled' => false, + 'created_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'bot_id' => 'botId', + 'name' => 'name', + 'setup_type' => 'setupType', + 'status' => 'status', + 'connected' => 'connected', + 'system_prompt' => 'systemPrompt', + 'model_id' => 'modelId', + 'temperature' => 'temperature', + 'max_tokens' => 'maxTokens', + 'allowed_tools' => 'allowedTools', + 'assigned_skills' => 'assignedSkills', + 'allowed_collections' => 'allowedCollections', + 'allowed_sub_agents' => 'allowedSubAgents', + 'guardrail_preset' => 'guardrailPreset', + 'filter_policies' => 'filterPolicies', + 'long_context' => 'longContext', + 'session_ttl_days' => 'sessionTtlDays', + 'keywords_enabled' => 'keywordsEnabled', + 'created_at' => 'createdAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bot_id' => 'setBotId', + 'name' => 'setName', + 'setup_type' => 'setSetupType', + 'status' => 'setStatus', + 'connected' => 'setConnected', + 'system_prompt' => 'setSystemPrompt', + 'model_id' => 'setModelId', + 'temperature' => 'setTemperature', + 'max_tokens' => 'setMaxTokens', + 'allowed_tools' => 'setAllowedTools', + 'assigned_skills' => 'setAssignedSkills', + 'allowed_collections' => 'setAllowedCollections', + 'allowed_sub_agents' => 'setAllowedSubAgents', + 'guardrail_preset' => 'setGuardrailPreset', + 'filter_policies' => 'setFilterPolicies', + 'long_context' => 'setLongContext', + 'session_ttl_days' => 'setSessionTtlDays', + 'keywords_enabled' => 'setKeywordsEnabled', + 'created_at' => 'setCreatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bot_id' => 'getBotId', + 'name' => 'getName', + 'setup_type' => 'getSetupType', + 'status' => 'getStatus', + 'connected' => 'getConnected', + 'system_prompt' => 'getSystemPrompt', + 'model_id' => 'getModelId', + 'temperature' => 'getTemperature', + 'max_tokens' => 'getMaxTokens', + 'allowed_tools' => 'getAllowedTools', + 'assigned_skills' => 'getAssignedSkills', + 'allowed_collections' => 'getAllowedCollections', + 'allowed_sub_agents' => 'getAllowedSubAgents', + 'guardrail_preset' => 'getGuardrailPreset', + 'filter_policies' => 'getFilterPolicies', + 'long_context' => 'getLongContext', + 'session_ttl_days' => 'getSessionTtlDays', + 'keywords_enabled' => 'getKeywordsEnabled', + 'created_at' => 'getCreatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const SETUP_TYPE_QUANT = 'quant'; + public const SETUP_TYPE_BYO = 'byo'; + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSetupTypeAllowableValues() + { + return [ + self::SETUP_TYPE_QUANT, + self::SETUP_TYPE_BYO, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('bot_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('setup_type', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('connected', $data ?? [], null); + $this->setIfExists('system_prompt', $data ?? [], null); + $this->setIfExists('model_id', $data ?? [], null); + $this->setIfExists('temperature', $data ?? [], null); + $this->setIfExists('max_tokens', $data ?? [], null); + $this->setIfExists('allowed_tools', $data ?? [], null); + $this->setIfExists('assigned_skills', $data ?? [], null); + $this->setIfExists('allowed_collections', $data ?? [], null); + $this->setIfExists('allowed_sub_agents', $data ?? [], null); + $this->setIfExists('guardrail_preset', $data ?? [], null); + $this->setIfExists('filter_policies', $data ?? [], null); + $this->setIfExists('long_context', $data ?? [], null); + $this->setIfExists('session_ttl_days', $data ?? [], null); + $this->setIfExists('keywords_enabled', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getSetupTypeAllowableValues(); + if (!is_null($this->container['setup_type']) && !in_array($this->container['setup_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'setup_type', must be one of '%s'", + $this->container['setup_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bot_id + * + * @return string|null + */ + public function getBotId() + { + return $this->container['bot_id']; + } + + /** + * Sets bot_id + * + * @param string|null $bot_id bot_id + * + * @return self + */ + public function setBotId($bot_id) + { + if (is_null($bot_id)) { + throw new \InvalidArgumentException('non-nullable bot_id cannot be null'); + } + $this->container['bot_id'] = $bot_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets setup_type + * + * @return string|null + */ + public function getSetupType() + { + return $this->container['setup_type']; + } + + /** + * Sets setup_type + * + * @param string|null $setup_type setup_type + * + * @return self + */ + public function setSetupType($setup_type) + { + if (is_null($setup_type)) { + throw new \InvalidArgumentException('non-nullable setup_type cannot be null'); + } + $allowedValues = $this->getSetupTypeAllowableValues(); + if (!in_array($setup_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'setup_type', must be one of '%s'", + $setup_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['setup_type'] = $setup_type; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets connected + * + * @return bool|null + */ + public function getConnected() + { + return $this->container['connected']; + } + + /** + * Sets connected + * + * @param bool|null $connected connected + * + * @return self + */ + public function setConnected($connected) + { + if (is_null($connected)) { + throw new \InvalidArgumentException('non-nullable connected cannot be null'); + } + $this->container['connected'] = $connected; + + return $this; + } + + /** + * Gets system_prompt + * + * @return string|null + */ + public function getSystemPrompt() + { + return $this->container['system_prompt']; + } + + /** + * Sets system_prompt + * + * @param string|null $system_prompt system_prompt + * + * @return self + */ + public function setSystemPrompt($system_prompt) + { + if (is_null($system_prompt)) { + throw new \InvalidArgumentException('non-nullable system_prompt cannot be null'); + } + $this->container['system_prompt'] = $system_prompt; + + return $this; + } + + /** + * Gets model_id + * + * @return string|null + */ + public function getModelId() + { + return $this->container['model_id']; + } + + /** + * Sets model_id + * + * @param string|null $model_id model_id + * + * @return self + */ + public function setModelId($model_id) + { + if (is_null($model_id)) { + throw new \InvalidArgumentException('non-nullable model_id cannot be null'); + } + $this->container['model_id'] = $model_id; + + return $this; + } + + /** + * Gets temperature + * + * @return float|null + */ + public function getTemperature() + { + return $this->container['temperature']; + } + + /** + * Sets temperature + * + * @param float|null $temperature temperature + * + * @return self + */ + public function setTemperature($temperature) + { + if (is_null($temperature)) { + throw new \InvalidArgumentException('non-nullable temperature cannot be null'); + } + $this->container['temperature'] = $temperature; + + return $this; + } + + /** + * Gets max_tokens + * + * @return int|null + */ + public function getMaxTokens() + { + return $this->container['max_tokens']; + } + + /** + * Sets max_tokens + * + * @param int|null $max_tokens max_tokens + * + * @return self + */ + public function setMaxTokens($max_tokens) + { + if (is_null($max_tokens)) { + throw new \InvalidArgumentException('non-nullable max_tokens cannot be null'); + } + $this->container['max_tokens'] = $max_tokens; + + return $this; + } + + /** + * Gets allowed_tools + * + * @return string[]|null + */ + public function getAllowedTools() + { + return $this->container['allowed_tools']; + } + + /** + * Sets allowed_tools + * + * @param string[]|null $allowed_tools allowed_tools + * + * @return self + */ + public function setAllowedTools($allowed_tools) + { + if (is_null($allowed_tools)) { + throw new \InvalidArgumentException('non-nullable allowed_tools cannot be null'); + } + $this->container['allowed_tools'] = $allowed_tools; + + return $this; + } + + /** + * Gets assigned_skills + * + * @return string[]|null + */ + public function getAssignedSkills() + { + return $this->container['assigned_skills']; + } + + /** + * Sets assigned_skills + * + * @param string[]|null $assigned_skills assigned_skills + * + * @return self + */ + public function setAssignedSkills($assigned_skills) + { + if (is_null($assigned_skills)) { + throw new \InvalidArgumentException('non-nullable assigned_skills cannot be null'); + } + $this->container['assigned_skills'] = $assigned_skills; + + return $this; + } + + /** + * Gets allowed_collections + * + * @return string[]|null + */ + public function getAllowedCollections() + { + return $this->container['allowed_collections']; + } + + /** + * Sets allowed_collections + * + * @param string[]|null $allowed_collections allowed_collections + * + * @return self + */ + public function setAllowedCollections($allowed_collections) + { + if (is_null($allowed_collections)) { + throw new \InvalidArgumentException('non-nullable allowed_collections cannot be null'); + } + $this->container['allowed_collections'] = $allowed_collections; + + return $this; + } + + /** + * Gets allowed_sub_agents + * + * @return string[]|null + */ + public function getAllowedSubAgents() + { + return $this->container['allowed_sub_agents']; + } + + /** + * Sets allowed_sub_agents + * + * @param string[]|null $allowed_sub_agents allowed_sub_agents + * + * @return self + */ + public function setAllowedSubAgents($allowed_sub_agents) + { + if (is_null($allowed_sub_agents)) { + throw new \InvalidArgumentException('non-nullable allowed_sub_agents cannot be null'); + } + $this->container['allowed_sub_agents'] = $allowed_sub_agents; + + return $this; + } + + /** + * Gets guardrail_preset + * + * @return string|null + */ + public function getGuardrailPreset() + { + return $this->container['guardrail_preset']; + } + + /** + * Sets guardrail_preset + * + * @param string|null $guardrail_preset guardrail_preset + * + * @return self + */ + public function setGuardrailPreset($guardrail_preset) + { + if (is_null($guardrail_preset)) { + throw new \InvalidArgumentException('non-nullable guardrail_preset cannot be null'); + } + $this->container['guardrail_preset'] = $guardrail_preset; + + return $this; + } + + /** + * Gets filter_policies + * + * @return string[]|null + */ + public function getFilterPolicies() + { + return $this->container['filter_policies']; + } + + /** + * Sets filter_policies + * + * @param string[]|null $filter_policies filter_policies + * + * @return self + */ + public function setFilterPolicies($filter_policies) + { + if (is_null($filter_policies)) { + throw new \InvalidArgumentException('non-nullable filter_policies cannot be null'); + } + $this->container['filter_policies'] = $filter_policies; + + return $this; + } + + /** + * Gets long_context + * + * @return bool|null + */ + public function getLongContext() + { + return $this->container['long_context']; + } + + /** + * Sets long_context + * + * @param bool|null $long_context long_context + * + * @return self + */ + public function setLongContext($long_context) + { + if (is_null($long_context)) { + throw new \InvalidArgumentException('non-nullable long_context cannot be null'); + } + $this->container['long_context'] = $long_context; + + return $this; + } + + /** + * Gets session_ttl_days + * + * @return int|null + */ + public function getSessionTtlDays() + { + return $this->container['session_ttl_days']; + } + + /** + * Sets session_ttl_days + * + * @param int|null $session_ttl_days session_ttl_days + * + * @return self + */ + public function setSessionTtlDays($session_ttl_days) + { + if (is_null($session_ttl_days)) { + throw new \InvalidArgumentException('non-nullable session_ttl_days cannot be null'); + } + $this->container['session_ttl_days'] = $session_ttl_days; + + return $this; + } + + /** + * Gets keywords_enabled + * + * @return bool|null + */ + public function getKeywordsEnabled() + { + return $this->container['keywords_enabled']; + } + + /** + * Sets keywords_enabled + * + * @param bool|null $keywords_enabled keywords_enabled + * + * @return self + */ + public function setKeywordsEnabled($keywords_enabled) + { + if (is_null($keywords_enabled)) { + throw new \InvalidArgumentException('non-nullable keywords_enabled cannot be null'); + } + $this->container['keywords_enabled'] = $keywords_enabled; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime|null $created_at created_at + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ListTasks200Response.php b/src/Model/ListTasks200Response.php index 8f6b0618..e027d948 100644 --- a/src/Model/ListTasks200Response.php +++ b/src/Model/ListTasks200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListTasks200ResponseTasksInner.php b/src/Model/ListTasks200ResponseTasksInner.php index f476bcc2..a1cf9378 100644 --- a/src/Model/ListTasks200ResponseTasksInner.php +++ b/src/Model/ListTasks200ResponseTasksInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListVectorCollections200Response.php b/src/Model/ListVectorCollections200Response.php index 3d87e5ec..647a6c87 100644 --- a/src/Model/ListVectorCollections200Response.php +++ b/src/Model/ListVectorCollections200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ListVectorCollections200ResponseCollectionsInner.php b/src/Model/ListVectorCollections200ResponseCollectionsInner.php index 3fc67436..d9ecd6fa 100644 --- a/src/Model/ListVectorCollections200ResponseCollectionsInner.php +++ b/src/Model/ListVectorCollections200ResponseCollectionsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ModelInterface.php b/src/Model/ModelInterface.php index 44527fb4..6bcdecf9 100644 --- a/src/Model/ModelInterface.php +++ b/src/Model/ModelInterface.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/OaiChatCompletions200Response.php b/src/Model/OaiChatCompletions200Response.php new file mode 100644 index 00000000..76bf6d7d --- /dev/null +++ b/src/Model/OaiChatCompletions200Response.php @@ -0,0 +1,579 @@ + + */ +class OaiChatCompletions200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'oaiChatCompletions_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'object' => 'string', + 'created' => 'int', + 'model' => 'string', + 'choices' => '\QuantClient\Model\OaiChatCompletions200ResponseChoicesInner[]', + 'usage' => '\QuantClient\Model\OaiChatCompletions200ResponseUsage' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'object' => null, + 'created' => null, + 'model' => null, + 'choices' => null, + 'usage' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'object' => false, + 'created' => false, + 'model' => false, + 'choices' => false, + 'usage' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'object' => 'object', + 'created' => 'created', + 'model' => 'model', + 'choices' => 'choices', + 'usage' => 'usage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'object' => 'setObject', + 'created' => 'setCreated', + 'model' => 'setModel', + 'choices' => 'setChoices', + 'usage' => 'setUsage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'object' => 'getObject', + 'created' => 'getCreated', + 'model' => 'getModel', + 'choices' => 'getChoices', + 'usage' => 'getUsage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('object', $data ?? [], null); + $this->setIfExists('created', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('choices', $data ?? [], null); + $this->setIfExists('usage', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets object + * + * @return string|null + */ + public function getObject() + { + return $this->container['object']; + } + + /** + * Sets object + * + * @param string|null $object object + * + * @return self + */ + public function setObject($object) + { + if (is_null($object)) { + throw new \InvalidArgumentException('non-nullable object cannot be null'); + } + $this->container['object'] = $object; + + return $this; + } + + /** + * Gets created + * + * @return int|null + */ + public function getCreated() + { + return $this->container['created']; + } + + /** + * Sets created + * + * @param int|null $created created + * + * @return self + */ + public function setCreated($created) + { + if (is_null($created)) { + throw new \InvalidArgumentException('non-nullable created cannot be null'); + } + $this->container['created'] = $created; + + return $this; + } + + /** + * Gets model + * + * @return string|null + */ + public function getModel() + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param string|null $model model + * + * @return self + */ + public function setModel($model) + { + if (is_null($model)) { + throw new \InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets choices + * + * @return \QuantClient\Model\OaiChatCompletions200ResponseChoicesInner[]|null + */ + public function getChoices() + { + return $this->container['choices']; + } + + /** + * Sets choices + * + * @param \QuantClient\Model\OaiChatCompletions200ResponseChoicesInner[]|null $choices choices + * + * @return self + */ + public function setChoices($choices) + { + if (is_null($choices)) { + throw new \InvalidArgumentException('non-nullable choices cannot be null'); + } + $this->container['choices'] = $choices; + + return $this; + } + + /** + * Gets usage + * + * @return \QuantClient\Model\OaiChatCompletions200ResponseUsage|null + */ + public function getUsage() + { + return $this->container['usage']; + } + + /** + * Sets usage + * + * @param \QuantClient\Model\OaiChatCompletions200ResponseUsage|null $usage usage + * + * @return self + */ + public function setUsage($usage) + { + if (is_null($usage)) { + throw new \InvalidArgumentException('non-nullable usage cannot be null'); + } + $this->container['usage'] = $usage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OaiChatCompletions200ResponseChoicesInner.php b/src/Model/OaiChatCompletions200ResponseChoicesInner.php new file mode 100644 index 00000000..ae667813 --- /dev/null +++ b/src/Model/OaiChatCompletions200ResponseChoicesInner.php @@ -0,0 +1,513 @@ + + */ +class OaiChatCompletions200ResponseChoicesInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'oaiChatCompletions_200_response_choices_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'index' => 'int', + 'message' => '\QuantClient\Model\OaiChatCompletions200ResponseChoicesInnerMessage', + 'finish_reason' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'index' => null, + 'message' => null, + 'finish_reason' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'index' => false, + 'message' => false, + 'finish_reason' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'index' => 'index', + 'message' => 'message', + 'finish_reason' => 'finish_reason' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'index' => 'setIndex', + 'message' => 'setMessage', + 'finish_reason' => 'setFinishReason' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'index' => 'getIndex', + 'message' => 'getMessage', + 'finish_reason' => 'getFinishReason' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const FINISH_REASON_STOP = 'stop'; + public const FINISH_REASON_TOOL_CALLS = 'tool_calls'; + public const FINISH_REASON_LENGTH = 'length'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFinishReasonAllowableValues() + { + return [ + self::FINISH_REASON_STOP, + self::FINISH_REASON_TOOL_CALLS, + self::FINISH_REASON_LENGTH, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('index', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('finish_reason', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getFinishReasonAllowableValues(); + if (!is_null($this->container['finish_reason']) && !in_array($this->container['finish_reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'finish_reason', must be one of '%s'", + $this->container['finish_reason'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets index + * + * @return int|null + */ + public function getIndex() + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param int|null $index index + * + * @return self + */ + public function setIndex($index) + { + if (is_null($index)) { + throw new \InvalidArgumentException('non-nullable index cannot be null'); + } + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets message + * + * @return \QuantClient\Model\OaiChatCompletions200ResponseChoicesInnerMessage|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param \QuantClient\Model\OaiChatCompletions200ResponseChoicesInnerMessage|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets finish_reason + * + * @return string|null + */ + public function getFinishReason() + { + return $this->container['finish_reason']; + } + + /** + * Sets finish_reason + * + * @param string|null $finish_reason finish_reason + * + * @return self + */ + public function setFinishReason($finish_reason) + { + if (is_null($finish_reason)) { + throw new \InvalidArgumentException('non-nullable finish_reason cannot be null'); + } + $allowedValues = $this->getFinishReasonAllowableValues(); + if (!in_array($finish_reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'finish_reason', must be one of '%s'", + $finish_reason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['finish_reason'] = $finish_reason; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OaiChatCompletions200ResponseChoicesInnerMessage.php b/src/Model/OaiChatCompletions200ResponseChoicesInnerMessage.php new file mode 100644 index 00000000..109bc4f8 --- /dev/null +++ b/src/Model/OaiChatCompletions200ResponseChoicesInnerMessage.php @@ -0,0 +1,484 @@ + + */ +class OaiChatCompletions200ResponseChoicesInnerMessage implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'oaiChatCompletions_200_response_choices_inner_message'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'role' => 'string', + 'content' => 'string', + 'tool_calls' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'role' => null, + 'content' => null, + 'tool_calls' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'role' => false, + 'content' => true, + 'tool_calls' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'role' => 'role', + 'content' => 'content', + 'tool_calls' => 'tool_calls' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'role' => 'setRole', + 'content' => 'setContent', + 'tool_calls' => 'setToolCalls' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'role' => 'getRole', + 'content' => 'getContent', + 'tool_calls' => 'getToolCalls' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('role', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('tool_calls', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets role + * + * @return string|null + */ + public function getRole() + { + return $this->container['role']; + } + + /** + * Sets role + * + * @param string|null $role role + * + * @return self + */ + public function setRole($role) + { + if (is_null($role)) { + throw new \InvalidArgumentException('non-nullable role cannot be null'); + } + $this->container['role'] = $role; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content content + * + * @return self + */ + public function setContent($content) + { + if (is_null($content)) { + array_push($this->openAPINullablesSetToNull, 'content'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('content', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets tool_calls + * + * @return object[]|null + */ + public function getToolCalls() + { + return $this->container['tool_calls']; + } + + /** + * Sets tool_calls + * + * @param object[]|null $tool_calls tool_calls + * + * @return self + */ + public function setToolCalls($tool_calls) + { + if (is_null($tool_calls)) { + throw new \InvalidArgumentException('non-nullable tool_calls cannot be null'); + } + $this->container['tool_calls'] = $tool_calls; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/GetAIUsageStats200Response.php b/src/Model/OaiChatCompletions200ResponseUsage.php similarity index 80% rename from src/Model/GetAIUsageStats200Response.php rename to src/Model/OaiChatCompletions200ResponseUsage.php index dcd4eedb..3f9a5306 100644 --- a/src/Model/GetAIUsageStats200Response.php +++ b/src/Model/OaiChatCompletions200ResponseUsage.php @@ -1,6 +1,6 @@ */ -class GetAIUsageStats200Response implements ModelInterface, ArrayAccess, \JsonSerializable +class OaiChatCompletions200ResponseUsage implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class GetAIUsageStats200Response implements ModelInterface, ArrayAccess, \JsonSe * * @var string */ - protected static $openAPIModelName = 'getAIUsageStats_200_response'; + protected static $openAPIModelName = 'oaiChatCompletions_200_response_usage'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,9 +57,9 @@ class GetAIUsageStats200Response implements ModelInterface, ArrayAccess, \JsonSe * @var string[] */ protected static $openAPITypes = [ - 'total_requests' => 'int', - 'total_tokens' => 'int', - 'by_model' => 'array' + 'prompt_tokens' => 'int', + 'completion_tokens' => 'int', + 'total_tokens' => 'int' ]; /** @@ -70,9 +70,9 @@ class GetAIUsageStats200Response implements ModelInterface, ArrayAccess, \JsonSe * @psalm-var array */ protected static $openAPIFormats = [ - 'total_requests' => null, - 'total_tokens' => null, - 'by_model' => null + 'prompt_tokens' => null, + 'completion_tokens' => null, + 'total_tokens' => null ]; /** @@ -81,9 +81,9 @@ class GetAIUsageStats200Response implements ModelInterface, ArrayAccess, \JsonSe * @var boolean[] */ protected static array $openAPINullables = [ - 'total_requests' => false, - 'total_tokens' => false, - 'by_model' => false + 'prompt_tokens' => false, + 'completion_tokens' => false, + 'total_tokens' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'total_requests' => 'total_requests', - 'total_tokens' => 'total_tokens', - 'by_model' => 'by_model' + 'prompt_tokens' => 'prompt_tokens', + 'completion_tokens' => 'completion_tokens', + 'total_tokens' => 'total_tokens' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'total_requests' => 'setTotalRequests', - 'total_tokens' => 'setTotalTokens', - 'by_model' => 'setByModel' + 'prompt_tokens' => 'setPromptTokens', + 'completion_tokens' => 'setCompletionTokens', + 'total_tokens' => 'setTotalTokens' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'total_requests' => 'getTotalRequests', - 'total_tokens' => 'getTotalTokens', - 'by_model' => 'getByModel' + 'prompt_tokens' => 'getPromptTokens', + 'completion_tokens' => 'getCompletionTokens', + 'total_tokens' => 'getTotalTokens' ]; /** @@ -256,9 +256,9 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('total_requests', $data ?? [], null); + $this->setIfExists('prompt_tokens', $data ?? [], null); + $this->setIfExists('completion_tokens', $data ?? [], null); $this->setIfExists('total_tokens', $data ?? [], null); - $this->setIfExists('by_model', $data ?? [], null); } /** @@ -304,82 +304,82 @@ public function valid() /** - * Gets total_requests + * Gets prompt_tokens * * @return int|null */ - public function getTotalRequests() + public function getPromptTokens() { - return $this->container['total_requests']; + return $this->container['prompt_tokens']; } /** - * Sets total_requests + * Sets prompt_tokens * - * @param int|null $total_requests Total number of API requests + * @param int|null $prompt_tokens prompt_tokens * * @return self */ - public function setTotalRequests($total_requests) + public function setPromptTokens($prompt_tokens) { - if (is_null($total_requests)) { - throw new \InvalidArgumentException('non-nullable total_requests cannot be null'); + if (is_null($prompt_tokens)) { + throw new \InvalidArgumentException('non-nullable prompt_tokens cannot be null'); } - $this->container['total_requests'] = $total_requests; + $this->container['prompt_tokens'] = $prompt_tokens; return $this; } /** - * Gets total_tokens + * Gets completion_tokens * * @return int|null */ - public function getTotalTokens() + public function getCompletionTokens() { - return $this->container['total_tokens']; + return $this->container['completion_tokens']; } /** - * Sets total_tokens + * Sets completion_tokens * - * @param int|null $total_tokens Total tokens consumed across all requests + * @param int|null $completion_tokens completion_tokens * * @return self */ - public function setTotalTokens($total_tokens) + public function setCompletionTokens($completion_tokens) { - if (is_null($total_tokens)) { - throw new \InvalidArgumentException('non-nullable total_tokens cannot be null'); + if (is_null($completion_tokens)) { + throw new \InvalidArgumentException('non-nullable completion_tokens cannot be null'); } - $this->container['total_tokens'] = $total_tokens; + $this->container['completion_tokens'] = $completion_tokens; return $this; } /** - * Gets by_model + * Gets total_tokens * - * @return array|null + * @return int|null */ - public function getByModel() + public function getTotalTokens() { - return $this->container['by_model']; + return $this->container['total_tokens']; } /** - * Sets by_model + * Sets total_tokens * - * @param array|null $by_model Usage breakdown by model ID + * @param int|null $total_tokens total_tokens * * @return self */ - public function setByModel($by_model) + public function setTotalTokens($total_tokens) { - if (is_null($by_model)) { - throw new \InvalidArgumentException('non-nullable by_model cannot be null'); + if (is_null($total_tokens)) { + throw new \InvalidArgumentException('non-nullable total_tokens cannot be null'); } - $this->container['by_model'] = $by_model; + $this->container['total_tokens'] = $total_tokens; return $this; } diff --git a/src/Model/OaiChatCompletionsRequest.php b/src/Model/OaiChatCompletionsRequest.php new file mode 100644 index 00000000..d85f8b80 --- /dev/null +++ b/src/Model/OaiChatCompletionsRequest.php @@ -0,0 +1,694 @@ + + */ +class OaiChatCompletionsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'oaiChatCompletions_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'model' => 'string', + 'messages' => '\QuantClient\Model\OaiChatCompletionsRequestMessagesInner[]', + 'stream' => 'bool', + 'max_tokens' => 'int', + 'temperature' => 'float', + 'top_p' => 'float', + 'tools' => 'object[]', + 'tool_choice' => 'mixed', + 'stream_options' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'model' => null, + 'messages' => null, + 'stream' => null, + 'max_tokens' => null, + 'temperature' => null, + 'top_p' => null, + 'tools' => null, + 'tool_choice' => null, + 'stream_options' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'model' => false, + 'messages' => false, + 'stream' => false, + 'max_tokens' => false, + 'temperature' => false, + 'top_p' => false, + 'tools' => false, + 'tool_choice' => true, + 'stream_options' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'model' => 'model', + 'messages' => 'messages', + 'stream' => 'stream', + 'max_tokens' => 'max_tokens', + 'temperature' => 'temperature', + 'top_p' => 'top_p', + 'tools' => 'tools', + 'tool_choice' => 'tool_choice', + 'stream_options' => 'stream_options' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'model' => 'setModel', + 'messages' => 'setMessages', + 'stream' => 'setStream', + 'max_tokens' => 'setMaxTokens', + 'temperature' => 'setTemperature', + 'top_p' => 'setTopP', + 'tools' => 'setTools', + 'tool_choice' => 'setToolChoice', + 'stream_options' => 'setStreamOptions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'model' => 'getModel', + 'messages' => 'getMessages', + 'stream' => 'getStream', + 'max_tokens' => 'getMaxTokens', + 'temperature' => 'getTemperature', + 'top_p' => 'getTopP', + 'tools' => 'getTools', + 'tool_choice' => 'getToolChoice', + 'stream_options' => 'getStreamOptions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('messages', $data ?? [], null); + $this->setIfExists('stream', $data ?? [], false); + $this->setIfExists('max_tokens', $data ?? [], null); + $this->setIfExists('temperature', $data ?? [], null); + $this->setIfExists('top_p', $data ?? [], null); + $this->setIfExists('tools', $data ?? [], null); + $this->setIfExists('tool_choice', $data ?? [], null); + $this->setIfExists('stream_options', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['model'] === null) { + $invalidProperties[] = "'model' can't be null"; + } + if ($this->container['messages'] === null) { + $invalidProperties[] = "'messages' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets model + * + * @return string + */ + public function getModel() + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param string $model A model id from GET /oai/v1/models + * + * @return self + */ + public function setModel($model) + { + if (is_null($model)) { + throw new \InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets messages + * + * @return \QuantClient\Model\OaiChatCompletionsRequestMessagesInner[] + */ + public function getMessages() + { + return $this->container['messages']; + } + + /** + * Sets messages + * + * @param \QuantClient\Model\OaiChatCompletionsRequestMessagesInner[] $messages messages + * + * @return self + */ + public function setMessages($messages) + { + if (is_null($messages)) { + throw new \InvalidArgumentException('non-nullable messages cannot be null'); + } + $this->container['messages'] = $messages; + + return $this; + } + + /** + * Gets stream + * + * @return bool|null + */ + public function getStream() + { + return $this->container['stream']; + } + + /** + * Sets stream + * + * @param bool|null $stream Stream the response as SSE chat.completion.chunk events + * + * @return self + */ + public function setStream($stream) + { + if (is_null($stream)) { + throw new \InvalidArgumentException('non-nullable stream cannot be null'); + } + $this->container['stream'] = $stream; + + return $this; + } + + /** + * Gets max_tokens + * + * @return int|null + */ + public function getMaxTokens() + { + return $this->container['max_tokens']; + } + + /** + * Sets max_tokens + * + * @param int|null $max_tokens max_tokens + * + * @return self + */ + public function setMaxTokens($max_tokens) + { + if (is_null($max_tokens)) { + throw new \InvalidArgumentException('non-nullable max_tokens cannot be null'); + } + $this->container['max_tokens'] = $max_tokens; + + return $this; + } + + /** + * Gets temperature + * + * @return float|null + */ + public function getTemperature() + { + return $this->container['temperature']; + } + + /** + * Sets temperature + * + * @param float|null $temperature temperature + * + * @return self + */ + public function setTemperature($temperature) + { + if (is_null($temperature)) { + throw new \InvalidArgumentException('non-nullable temperature cannot be null'); + } + $this->container['temperature'] = $temperature; + + return $this; + } + + /** + * Gets top_p + * + * @return float|null + */ + public function getTopP() + { + return $this->container['top_p']; + } + + /** + * Sets top_p + * + * @param float|null $top_p top_p + * + * @return self + */ + public function setTopP($top_p) + { + if (is_null($top_p)) { + throw new \InvalidArgumentException('non-nullable top_p cannot be null'); + } + $this->container['top_p'] = $top_p; + + return $this; + } + + /** + * Gets tools + * + * @return object[]|null + */ + public function getTools() + { + return $this->container['tools']; + } + + /** + * Sets tools + * + * @param object[]|null $tools OpenAI function tool definitions + * + * @return self + */ + public function setTools($tools) + { + if (is_null($tools)) { + throw new \InvalidArgumentException('non-nullable tools cannot be null'); + } + $this->container['tools'] = $tools; + + return $this; + } + + /** + * Gets tool_choice + * + * @return mixed|null + */ + public function getToolChoice() + { + return $this->container['tool_choice']; + } + + /** + * Sets tool_choice + * + * @param mixed|null $tool_choice auto | none | required | {type:function, function:{name}} + * + * @return self + */ + public function setToolChoice($tool_choice) + { + if (is_null($tool_choice)) { + array_push($this->openAPINullablesSetToNull, 'tool_choice'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tool_choice', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tool_choice'] = $tool_choice; + + return $this; + } + + /** + * Gets stream_options + * + * @return object|null + */ + public function getStreamOptions() + { + return $this->container['stream_options']; + } + + /** + * Sets stream_options + * + * @param object|null $stream_options {include_usage: true} to emit a final usage chunk when streaming + * + * @return self + */ + public function setStreamOptions($stream_options) + { + if (is_null($stream_options)) { + throw new \InvalidArgumentException('non-nullable stream_options cannot be null'); + } + $this->container['stream_options'] = $stream_options; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OaiChatCompletionsRequestMessagesInner.php b/src/Model/OaiChatCompletionsRequestMessagesInner.php new file mode 100644 index 00000000..85149e36 --- /dev/null +++ b/src/Model/OaiChatCompletionsRequestMessagesInner.php @@ -0,0 +1,481 @@ + + */ +class OaiChatCompletionsRequestMessagesInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'oaiChatCompletions_request_messages_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'role' => 'string', + 'content' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'role' => null, + 'content' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'role' => false, + 'content' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'role' => 'role', + 'content' => 'content' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'role' => 'setRole', + 'content' => 'setContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'role' => 'getRole', + 'content' => 'getContent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const ROLE_SYSTEM = 'system'; + public const ROLE_USER = 'user'; + public const ROLE_ASSISTANT = 'assistant'; + public const ROLE_TOOL = 'tool'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRoleAllowableValues() + { + return [ + self::ROLE_SYSTEM, + self::ROLE_USER, + self::ROLE_ASSISTANT, + self::ROLE_TOOL, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('role', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getRoleAllowableValues(); + if (!is_null($this->container['role']) && !in_array($this->container['role'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'role', must be one of '%s'", + $this->container['role'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets role + * + * @return string|null + */ + public function getRole() + { + return $this->container['role']; + } + + /** + * Sets role + * + * @param string|null $role role + * + * @return self + */ + public function setRole($role) + { + if (is_null($role)) { + throw new \InvalidArgumentException('non-nullable role cannot be null'); + } + $allowedValues = $this->getRoleAllowableValues(); + if (!in_array($role, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'role', must be one of '%s'", + $role, + implode("', '", $allowedValues) + ) + ); + } + $this->container['role'] = $role; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content content + * + * @return self + */ + public function setContent($content) + { + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OaiEmbeddings200Response.php b/src/Model/OaiEmbeddings200Response.php new file mode 100644 index 00000000..5ad4ac36 --- /dev/null +++ b/src/Model/OaiEmbeddings200Response.php @@ -0,0 +1,511 @@ + + */ +class OaiEmbeddings200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'oaiEmbeddings_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'object' => 'string', + 'data' => '\QuantClient\Model\OaiEmbeddings200ResponseDataInner[]', + 'model' => 'string', + 'usage' => '\QuantClient\Model\OaiEmbeddings200ResponseUsage' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'object' => null, + 'data' => null, + 'model' => null, + 'usage' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'object' => false, + 'data' => false, + 'model' => false, + 'usage' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'object' => 'object', + 'data' => 'data', + 'model' => 'model', + 'usage' => 'usage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'object' => 'setObject', + 'data' => 'setData', + 'model' => 'setModel', + 'usage' => 'setUsage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'object' => 'getObject', + 'data' => 'getData', + 'model' => 'getModel', + 'usage' => 'getUsage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('object', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('usage', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets object + * + * @return string|null + */ + public function getObject() + { + return $this->container['object']; + } + + /** + * Sets object + * + * @param string|null $object object + * + * @return self + */ + public function setObject($object) + { + if (is_null($object)) { + throw new \InvalidArgumentException('non-nullable object cannot be null'); + } + $this->container['object'] = $object; + + return $this; + } + + /** + * Gets data + * + * @return \QuantClient\Model\OaiEmbeddings200ResponseDataInner[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \QuantClient\Model\OaiEmbeddings200ResponseDataInner[]|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets model + * + * @return string|null + */ + public function getModel() + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param string|null $model model + * + * @return self + */ + public function setModel($model) + { + if (is_null($model)) { + throw new \InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets usage + * + * @return \QuantClient\Model\OaiEmbeddings200ResponseUsage|null + */ + public function getUsage() + { + return $this->container['usage']; + } + + /** + * Sets usage + * + * @param \QuantClient\Model\OaiEmbeddings200ResponseUsage|null $usage usage + * + * @return self + */ + public function setUsage($usage) + { + if (is_null($usage)) { + throw new \InvalidArgumentException('non-nullable usage cannot be null'); + } + $this->container['usage'] = $usage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OaiEmbeddings200ResponseDataInner.php b/src/Model/OaiEmbeddings200ResponseDataInner.php new file mode 100644 index 00000000..c1209724 --- /dev/null +++ b/src/Model/OaiEmbeddings200ResponseDataInner.php @@ -0,0 +1,477 @@ + + */ +class OaiEmbeddings200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'oaiEmbeddings_200_response_data_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'object' => 'string', + 'index' => 'int', + 'embedding' => 'float[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'object' => null, + 'index' => null, + 'embedding' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'object' => false, + 'index' => false, + 'embedding' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'object' => 'object', + 'index' => 'index', + 'embedding' => 'embedding' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'object' => 'setObject', + 'index' => 'setIndex', + 'embedding' => 'setEmbedding' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'object' => 'getObject', + 'index' => 'getIndex', + 'embedding' => 'getEmbedding' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('object', $data ?? [], null); + $this->setIfExists('index', $data ?? [], null); + $this->setIfExists('embedding', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets object + * + * @return string|null + */ + public function getObject() + { + return $this->container['object']; + } + + /** + * Sets object + * + * @param string|null $object object + * + * @return self + */ + public function setObject($object) + { + if (is_null($object)) { + throw new \InvalidArgumentException('non-nullable object cannot be null'); + } + $this->container['object'] = $object; + + return $this; + } + + /** + * Gets index + * + * @return int|null + */ + public function getIndex() + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param int|null $index index + * + * @return self + */ + public function setIndex($index) + { + if (is_null($index)) { + throw new \InvalidArgumentException('non-nullable index cannot be null'); + } + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets embedding + * + * @return float[]|null + */ + public function getEmbedding() + { + return $this->container['embedding']; + } + + /** + * Sets embedding + * + * @param float[]|null $embedding embedding + * + * @return self + */ + public function setEmbedding($embedding) + { + if (is_null($embedding)) { + throw new \InvalidArgumentException('non-nullable embedding cannot be null'); + } + $this->container['embedding'] = $embedding; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OaiEmbeddings200ResponseUsage.php b/src/Model/OaiEmbeddings200ResponseUsage.php new file mode 100644 index 00000000..c156d4f1 --- /dev/null +++ b/src/Model/OaiEmbeddings200ResponseUsage.php @@ -0,0 +1,443 @@ + + */ +class OaiEmbeddings200ResponseUsage implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'oaiEmbeddings_200_response_usage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'prompt_tokens' => 'int', + 'total_tokens' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'prompt_tokens' => null, + 'total_tokens' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'prompt_tokens' => false, + 'total_tokens' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'prompt_tokens' => 'prompt_tokens', + 'total_tokens' => 'total_tokens' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'prompt_tokens' => 'setPromptTokens', + 'total_tokens' => 'setTotalTokens' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'prompt_tokens' => 'getPromptTokens', + 'total_tokens' => 'getTotalTokens' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('prompt_tokens', $data ?? [], null); + $this->setIfExists('total_tokens', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets prompt_tokens + * + * @return int|null + */ + public function getPromptTokens() + { + return $this->container['prompt_tokens']; + } + + /** + * Sets prompt_tokens + * + * @param int|null $prompt_tokens prompt_tokens + * + * @return self + */ + public function setPromptTokens($prompt_tokens) + { + if (is_null($prompt_tokens)) { + throw new \InvalidArgumentException('non-nullable prompt_tokens cannot be null'); + } + $this->container['prompt_tokens'] = $prompt_tokens; + + return $this; + } + + /** + * Gets total_tokens + * + * @return int|null + */ + public function getTotalTokens() + { + return $this->container['total_tokens']; + } + + /** + * Sets total_tokens + * + * @param int|null $total_tokens total_tokens + * + * @return self + */ + public function setTotalTokens($total_tokens) + { + if (is_null($total_tokens)) { + throw new \InvalidArgumentException('non-nullable total_tokens cannot be null'); + } + $this->container['total_tokens'] = $total_tokens; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OaiEmbeddingsRequest.php b/src/Model/OaiEmbeddingsRequest.php new file mode 100644 index 00000000..a1df06f3 --- /dev/null +++ b/src/Model/OaiEmbeddingsRequest.php @@ -0,0 +1,456 @@ + + */ +class OaiEmbeddingsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'oaiEmbeddings_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'model' => 'string', + 'input' => 'mixed' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'model' => null, + 'input' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'model' => false, + 'input' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'model' => 'model', + 'input' => 'input' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'model' => 'setModel', + 'input' => 'setInput' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'model' => 'getModel', + 'input' => 'getInput' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('model', $data ?? [], null); + $this->setIfExists('input', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['model'] === null) { + $invalidProperties[] = "'model' can't be null"; + } + if ($this->container['input'] === null) { + $invalidProperties[] = "'input' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets model + * + * @return string + */ + public function getModel() + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param string $model model + * + * @return self + */ + public function setModel($model) + { + if (is_null($model)) { + throw new \InvalidArgumentException('non-nullable model cannot be null'); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets input + * + * @return mixed + */ + public function getInput() + { + return $this->container['input']; + } + + /** + * Sets input + * + * @param mixed $input A string or array of strings to embed + * + * @return self + */ + public function setInput($input) + { + if (is_null($input)) { + array_push($this->openAPINullablesSetToNull, 'input'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('input', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['input'] = $input; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OaiGetModel200Response.php b/src/Model/OaiGetModel200Response.php new file mode 100644 index 00000000..307556d3 --- /dev/null +++ b/src/Model/OaiGetModel200Response.php @@ -0,0 +1,511 @@ + + */ +class OaiGetModel200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'oaiGetModel_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'object' => 'string', + 'created' => 'int', + 'owned_by' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'object' => null, + 'created' => null, + 'owned_by' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'object' => false, + 'created' => false, + 'owned_by' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'object' => 'object', + 'created' => 'created', + 'owned_by' => 'owned_by' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'object' => 'setObject', + 'created' => 'setCreated', + 'owned_by' => 'setOwnedBy' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'object' => 'getObject', + 'created' => 'getCreated', + 'owned_by' => 'getOwnedBy' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('object', $data ?? [], null); + $this->setIfExists('created', $data ?? [], null); + $this->setIfExists('owned_by', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets object + * + * @return string|null + */ + public function getObject() + { + return $this->container['object']; + } + + /** + * Sets object + * + * @param string|null $object object + * + * @return self + */ + public function setObject($object) + { + if (is_null($object)) { + throw new \InvalidArgumentException('non-nullable object cannot be null'); + } + $this->container['object'] = $object; + + return $this; + } + + /** + * Gets created + * + * @return int|null + */ + public function getCreated() + { + return $this->container['created']; + } + + /** + * Sets created + * + * @param int|null $created created + * + * @return self + */ + public function setCreated($created) + { + if (is_null($created)) { + throw new \InvalidArgumentException('non-nullable created cannot be null'); + } + $this->container['created'] = $created; + + return $this; + } + + /** + * Gets owned_by + * + * @return string|null + */ + public function getOwnedBy() + { + return $this->container['owned_by']; + } + + /** + * Sets owned_by + * + * @param string|null $owned_by owned_by + * + * @return self + */ + public function setOwnedBy($owned_by) + { + if (is_null($owned_by)) { + throw new \InvalidArgumentException('non-nullable owned_by cannot be null'); + } + $this->container['owned_by'] = $owned_by; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OaiListModels200Response.php b/src/Model/OaiListModels200Response.php new file mode 100644 index 00000000..21f117a2 --- /dev/null +++ b/src/Model/OaiListModels200Response.php @@ -0,0 +1,443 @@ + + */ +class OaiListModels200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'oaiListModels_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'object' => 'string', + 'data' => '\QuantClient\Model\OaiListModels200ResponseDataInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'object' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'object' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'object' => 'object', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'object' => 'setObject', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'object' => 'getObject', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('object', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets object + * + * @return string|null + */ + public function getObject() + { + return $this->container['object']; + } + + /** + * Sets object + * + * @param string|null $object object + * + * @return self + */ + public function setObject($object) + { + if (is_null($object)) { + throw new \InvalidArgumentException('non-nullable object cannot be null'); + } + $this->container['object'] = $object; + + return $this; + } + + /** + * Gets data + * + * @return \QuantClient\Model\OaiListModels200ResponseDataInner[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \QuantClient\Model\OaiListModels200ResponseDataInner[]|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OaiListModels200ResponseDataInner.php b/src/Model/OaiListModels200ResponseDataInner.php new file mode 100644 index 00000000..d62a9756 --- /dev/null +++ b/src/Model/OaiListModels200ResponseDataInner.php @@ -0,0 +1,511 @@ + + */ +class OaiListModels200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'oaiListModels_200_response_data_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'object' => 'string', + 'created' => 'int', + 'owned_by' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'object' => null, + 'created' => null, + 'owned_by' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'object' => false, + 'created' => false, + 'owned_by' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'object' => 'object', + 'created' => 'created', + 'owned_by' => 'owned_by' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'object' => 'setObject', + 'created' => 'setCreated', + 'owned_by' => 'setOwnedBy' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'object' => 'getObject', + 'created' => 'getCreated', + 'owned_by' => 'getOwnedBy' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('object', $data ?? [], null); + $this->setIfExists('created', $data ?? [], null); + $this->setIfExists('owned_by', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets object + * + * @return string|null + */ + public function getObject() + { + return $this->container['object']; + } + + /** + * Sets object + * + * @param string|null $object object + * + * @return self + */ + public function setObject($object) + { + if (is_null($object)) { + throw new \InvalidArgumentException('non-nullable object cannot be null'); + } + $this->container['object'] = $object; + + return $this; + } + + /** + * Gets created + * + * @return int|null + */ + public function getCreated() + { + return $this->container['created']; + } + + /** + * Sets created + * + * @param int|null $created created + * + * @return self + */ + public function setCreated($created) + { + if (is_null($created)) { + throw new \InvalidArgumentException('non-nullable created cannot be null'); + } + $this->container['created'] = $created; + + return $this; + } + + /** + * Gets owned_by + * + * @return string|null + */ + public function getOwnedBy() + { + return $this->container['owned_by']; + } + + /** + * Sets owned_by + * + * @param string|null $owned_by owned_by + * + * @return self + */ + public function setOwnedBy($owned_by) + { + if (is_null($owned_by)) { + throw new \InvalidArgumentException('non-nullable owned_by cannot be null'); + } + $this->container['owned_by'] = $owned_by; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/OrganizationsList200ResponseInner.php b/src/Model/OrganizationsList200ResponseInner.php index 2d20f7fc..cbed9a06 100644 --- a/src/Model/OrganizationsList200ResponseInner.php +++ b/src/Model/OrganizationsList200ResponseInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/PatchEnvironmentCompose202Response.php b/src/Model/PatchEnvironmentCompose202Response.php index ddab55f6..41f98970 100644 --- a/src/Model/PatchEnvironmentCompose202Response.php +++ b/src/Model/PatchEnvironmentCompose202Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/PatchEnvironmentCompose202ResponseSpotConfiguration.php b/src/Model/PatchEnvironmentCompose202ResponseSpotConfiguration.php index ab44601a..1b8bad2c 100644 --- a/src/Model/PatchEnvironmentCompose202ResponseSpotConfiguration.php +++ b/src/Model/PatchEnvironmentCompose202ResponseSpotConfiguration.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/PatchEnvironmentCompose400Response.php b/src/Model/PatchEnvironmentCompose400Response.php index 9e6c5b95..509b93aa 100644 --- a/src/Model/PatchEnvironmentCompose400Response.php +++ b/src/Model/PatchEnvironmentCompose400Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/PatchEnvironmentComposeRequest.php b/src/Model/PatchEnvironmentComposeRequest.php index 6c7e380c..386d29f3 100644 --- a/src/Model/PatchEnvironmentComposeRequest.php +++ b/src/Model/PatchEnvironmentComposeRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -62,6 +62,8 @@ class PatchEnvironmentComposeRequest implements ModelInterface, ArrayAccess, \Js 'task_memory' => 'string', 'min_capacity' => 'int', 'max_capacity' => 'int', + 'single_task_only' => 'bool', + 'startup_grace_period_seconds' => 'int', 'containers' => 'object[]', 'spot_configuration' => '\QuantClient\Model\PatchEnvironmentComposeRequestSpotConfiguration', 'enable_cross_env_networking' => 'bool', @@ -81,6 +83,8 @@ class PatchEnvironmentComposeRequest implements ModelInterface, ArrayAccess, \Js 'task_memory' => null, 'min_capacity' => null, 'max_capacity' => null, + 'single_task_only' => null, + 'startup_grace_period_seconds' => null, 'containers' => null, 'spot_configuration' => null, 'enable_cross_env_networking' => null, @@ -98,6 +102,8 @@ class PatchEnvironmentComposeRequest implements ModelInterface, ArrayAccess, \Js 'task_memory' => true, 'min_capacity' => true, 'max_capacity' => true, + 'single_task_only' => true, + 'startup_grace_period_seconds' => true, 'containers' => true, 'spot_configuration' => true, 'enable_cross_env_networking' => true, @@ -195,6 +201,8 @@ public function isNullableSetToNull(string $property): bool 'task_memory' => 'taskMemory', 'min_capacity' => 'minCapacity', 'max_capacity' => 'maxCapacity', + 'single_task_only' => 'singleTaskOnly', + 'startup_grace_period_seconds' => 'startupGracePeriodSeconds', 'containers' => 'containers', 'spot_configuration' => 'spotConfiguration', 'enable_cross_env_networking' => 'enableCrossEnvNetworking', @@ -212,6 +220,8 @@ public function isNullableSetToNull(string $property): bool 'task_memory' => 'setTaskMemory', 'min_capacity' => 'setMinCapacity', 'max_capacity' => 'setMaxCapacity', + 'single_task_only' => 'setSingleTaskOnly', + 'startup_grace_period_seconds' => 'setStartupGracePeriodSeconds', 'containers' => 'setContainers', 'spot_configuration' => 'setSpotConfiguration', 'enable_cross_env_networking' => 'setEnableCrossEnvNetworking', @@ -229,6 +239,8 @@ public function isNullableSetToNull(string $property): bool 'task_memory' => 'getTaskMemory', 'min_capacity' => 'getMinCapacity', 'max_capacity' => 'getMaxCapacity', + 'single_task_only' => 'getSingleTaskOnly', + 'startup_grace_period_seconds' => 'getStartupGracePeriodSeconds', 'containers' => 'getContainers', 'spot_configuration' => 'getSpotConfiguration', 'enable_cross_env_networking' => 'getEnableCrossEnvNetworking', @@ -297,6 +309,8 @@ public function __construct(?array $data = null) $this->setIfExists('task_memory', $data ?? [], null); $this->setIfExists('min_capacity', $data ?? [], null); $this->setIfExists('max_capacity', $data ?? [], null); + $this->setIfExists('single_task_only', $data ?? [], null); + $this->setIfExists('startup_grace_period_seconds', $data ?? [], null); $this->setIfExists('containers', $data ?? [], null); $this->setIfExists('spot_configuration', $data ?? [], null); $this->setIfExists('enable_cross_env_networking', $data ?? [], null); @@ -338,6 +352,14 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'max_capacity', must be bigger than or equal to 1."; } + if (!is_null($this->container['startup_grace_period_seconds']) && ($this->container['startup_grace_period_seconds'] > 3600)) { + $invalidProperties[] = "invalid value for 'startup_grace_period_seconds', must be smaller than or equal to 3600."; + } + + if (!is_null($this->container['startup_grace_period_seconds']) && ($this->container['startup_grace_period_seconds'] < 0)) { + $invalidProperties[] = "invalid value for 'startup_grace_period_seconds', must be bigger than or equal to 0."; + } + return $invalidProperties; } @@ -533,6 +555,82 @@ public function setMaxCapacity($max_capacity) return $this; } + /** + * Gets single_task_only + * + * @return bool|null + */ + public function getSingleTaskOnly() + { + return $this->container['single_task_only']; + } + + /** + * Sets single_task_only + * + * @param bool|null $single_task_only Forces single-task mode (max one running task). Omitted = auto-detect from stateful containers. + * + * @return self + */ + public function setSingleTaskOnly($single_task_only) + { + if (is_null($single_task_only)) { + array_push($this->openAPINullablesSetToNull, 'single_task_only'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('single_task_only', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['single_task_only'] = $single_task_only; + + return $this; + } + + /** + * Gets startup_grace_period_seconds + * + * @return int|null + */ + public function getStartupGracePeriodSeconds() + { + return $this->container['startup_grace_period_seconds']; + } + + /** + * Sets startup_grace_period_seconds + * + * @param int|null $startup_grace_period_seconds Seconds the load balancer waits after a task starts before an unhealthy health check can replace it. Default 120. + * + * @return self + */ + public function setStartupGracePeriodSeconds($startup_grace_period_seconds) + { + if (is_null($startup_grace_period_seconds)) { + array_push($this->openAPINullablesSetToNull, 'startup_grace_period_seconds'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('startup_grace_period_seconds', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($startup_grace_period_seconds) && ($startup_grace_period_seconds > 3600)) { + throw new \InvalidArgumentException('invalid value for $startup_grace_period_seconds when calling PatchEnvironmentComposeRequest., must be smaller than or equal to 3600.'); + } + if (!is_null($startup_grace_period_seconds) && ($startup_grace_period_seconds < 0)) { + throw new \InvalidArgumentException('invalid value for $startup_grace_period_seconds when calling PatchEnvironmentComposeRequest., must be bigger than or equal to 0.'); + } + + $this->container['startup_grace_period_seconds'] = $startup_grace_period_seconds; + + return $this; + } + /** * Gets containers * diff --git a/src/Model/PatchEnvironmentComposeRequestSpotConfiguration.php b/src/Model/PatchEnvironmentComposeRequestSpotConfiguration.php index 3914a03b..64f1a1ae 100644 --- a/src/Model/PatchEnvironmentComposeRequestSpotConfiguration.php +++ b/src/Model/PatchEnvironmentComposeRequestSpotConfiguration.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/PurgeCreateRequest.php b/src/Model/PurgeCreateRequest.php index 133be9b3..a6f63c79 100644 --- a/src/Model/PurgeCreateRequest.php +++ b/src/Model/PurgeCreateRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/QueryVectorCollection200Response.php b/src/Model/QueryVectorCollection200Response.php index 6cb1c64b..fe89854c 100644 --- a/src/Model/QueryVectorCollection200Response.php +++ b/src/Model/QueryVectorCollection200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/QueryVectorCollection200ResponsePagination.php b/src/Model/QueryVectorCollection200ResponsePagination.php index c22e0666..657b75a1 100644 --- a/src/Model/QueryVectorCollection200ResponsePagination.php +++ b/src/Model/QueryVectorCollection200ResponsePagination.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/QueryVectorCollection200ResponseResultsInner.php b/src/Model/QueryVectorCollection200ResponseResultsInner.php index 50a399b9..71a29561 100644 --- a/src/Model/QueryVectorCollection200ResponseResultsInner.php +++ b/src/Model/QueryVectorCollection200ResponseResultsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/QueryVectorCollectionRequest.php b/src/Model/QueryVectorCollectionRequest.php index 265e2ab2..9d14a7c9 100644 --- a/src/Model/QueryVectorCollectionRequest.php +++ b/src/Model/QueryVectorCollectionRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/QueryVectorCollectionRequestFilter.php b/src/Model/QueryVectorCollectionRequestFilter.php index eebf81d3..da6d6bb1 100644 --- a/src/Model/QueryVectorCollectionRequestFilter.php +++ b/src/Model/QueryVectorCollectionRequestFilter.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/RestoreDatabase202Response.php b/src/Model/RestoreDatabase202Response.php new file mode 100644 index 00000000..9125d03f --- /dev/null +++ b/src/Model/RestoreDatabase202Response.php @@ -0,0 +1,477 @@ + + */ +class RestoreDatabase202Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'restoreDatabase_202_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'restore_id' => 'string', + 'status' => 'string', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'restore_id' => null, + 'status' => null, + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'restore_id' => false, + 'status' => false, + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'restore_id' => 'restoreId', + 'status' => 'status', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'restore_id' => 'setRestoreId', + 'status' => 'setStatus', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'restore_id' => 'getRestoreId', + 'status' => 'getStatus', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('restore_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets restore_id + * + * @return string|null + */ + public function getRestoreId() + { + return $this->container['restore_id']; + } + + /** + * Sets restore_id + * + * @param string|null $restore_id restore_id + * + * @return self + */ + public function setRestoreId($restore_id) + { + if (is_null($restore_id)) { + throw new \InvalidArgumentException('non-nullable restore_id cannot be null'); + } + $this->container['restore_id'] = $restore_id; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/RestoreDatabaseRequest.php b/src/Model/RestoreDatabaseRequest.php new file mode 100644 index 00000000..4d1080a9 --- /dev/null +++ b/src/Model/RestoreDatabaseRequest.php @@ -0,0 +1,449 @@ + + */ +class RestoreDatabaseRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'restoreDatabase_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'backup_id' => 'string', + 'acknowledge_dataloss' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'backup_id' => null, + 'acknowledge_dataloss' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'backup_id' => false, + 'acknowledge_dataloss' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'backup_id' => 'backupId', + 'acknowledge_dataloss' => 'acknowledgeDataloss' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'backup_id' => 'setBackupId', + 'acknowledge_dataloss' => 'setAcknowledgeDataloss' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'backup_id' => 'getBackupId', + 'acknowledge_dataloss' => 'getAcknowledgeDataloss' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('backup_id', $data ?? [], null); + $this->setIfExists('acknowledge_dataloss', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['backup_id'] === null) { + $invalidProperties[] = "'backup_id' can't be null"; + } + if ($this->container['acknowledge_dataloss'] === null) { + $invalidProperties[] = "'acknowledge_dataloss' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets backup_id + * + * @return string + */ + public function getBackupId() + { + return $this->container['backup_id']; + } + + /** + * Sets backup_id + * + * @param string $backup_id The backup ID to restore (must match path param) + * + * @return self + */ + public function setBackupId($backup_id) + { + if (is_null($backup_id)) { + throw new \InvalidArgumentException('non-nullable backup_id cannot be null'); + } + $this->container['backup_id'] = $backup_id; + + return $this; + } + + /** + * Gets acknowledge_dataloss + * + * @return bool + */ + public function getAcknowledgeDataloss() + { + return $this->container['acknowledge_dataloss']; + } + + /** + * Sets acknowledge_dataloss + * + * @param bool $acknowledge_dataloss Must be true to confirm existing data will be overwritten + * + * @return self + */ + public function setAcknowledgeDataloss($acknowledge_dataloss) + { + if (is_null($acknowledge_dataloss)) { + throw new \InvalidArgumentException('non-nullable acknowledge_dataloss cannot be null'); + } + $this->container['acknowledge_dataloss'] = $acknowledge_dataloss; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ApplicationEnvironmentsInner.php b/src/Model/RestoreFilesystem202Response.php similarity index 78% rename from src/Model/ApplicationEnvironmentsInner.php rename to src/Model/RestoreFilesystem202Response.php index 793a69ec..abde5c22 100644 --- a/src/Model/ApplicationEnvironmentsInner.php +++ b/src/Model/RestoreFilesystem202Response.php @@ -1,6 +1,6 @@ */ -class ApplicationEnvironmentsInner implements ModelInterface, ArrayAccess, \JsonSerializable +class RestoreFilesystem202Response implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class ApplicationEnvironmentsInner implements ModelInterface, ArrayAccess, \Json * * @var string */ - protected static $openAPIModelName = 'Application_environments_inner'; + protected static $openAPIModelName = 'restoreFilesystem_202_response'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,10 +57,9 @@ class ApplicationEnvironmentsInner implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ - 'env_name' => 'string', + 'restore_id' => 'string', 'status' => 'string', - 'running_count' => 'int', - 'desired_count' => 'int' + 'message' => 'string' ]; /** @@ -71,10 +70,9 @@ class ApplicationEnvironmentsInner implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ - 'env_name' => null, + 'restore_id' => null, 'status' => null, - 'running_count' => null, - 'desired_count' => null + 'message' => null ]; /** @@ -83,10 +81,9 @@ class ApplicationEnvironmentsInner implements ModelInterface, ArrayAccess, \Json * @var boolean[] */ protected static array $openAPINullables = [ - 'env_name' => false, + 'restore_id' => false, 'status' => false, - 'running_count' => false, - 'desired_count' => false + 'message' => false ]; /** @@ -175,10 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'env_name' => 'envName', + 'restore_id' => 'restoreId', 'status' => 'status', - 'running_count' => 'runningCount', - 'desired_count' => 'desiredCount' + 'message' => 'message' ]; /** @@ -187,10 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'env_name' => 'setEnvName', + 'restore_id' => 'setRestoreId', 'status' => 'setStatus', - 'running_count' => 'setRunningCount', - 'desired_count' => 'setDesiredCount' + 'message' => 'setMessage' ]; /** @@ -199,10 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'env_name' => 'getEnvName', + 'restore_id' => 'getRestoreId', 'status' => 'getStatus', - 'running_count' => 'getRunningCount', - 'desired_count' => 'getDesiredCount' + 'message' => 'getMessage' ]; /** @@ -262,10 +256,9 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('env_name', $data ?? [], null); + $this->setIfExists('restore_id', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('running_count', $data ?? [], null); - $this->setIfExists('desired_count', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); } /** @@ -311,28 +304,28 @@ public function valid() /** - * Gets env_name + * Gets restore_id * * @return string|null */ - public function getEnvName() + public function getRestoreId() { - return $this->container['env_name']; + return $this->container['restore_id']; } /** - * Sets env_name + * Sets restore_id * - * @param string|null $env_name Environment name + * @param string|null $restore_id restore_id * * @return self */ - public function setEnvName($env_name) + public function setRestoreId($restore_id) { - if (is_null($env_name)) { - throw new \InvalidArgumentException('non-nullable env_name cannot be null'); + if (is_null($restore_id)) { + throw new \InvalidArgumentException('non-nullable restore_id cannot be null'); } - $this->container['env_name'] = $env_name; + $this->container['restore_id'] = $restore_id; return $this; } @@ -350,7 +343,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status Environment status + * @param string|null $status status * * @return self */ @@ -365,55 +358,28 @@ public function setStatus($status) } /** - * Gets running_count + * Gets message * - * @return int|null - */ - public function getRunningCount() - { - return $this->container['running_count']; - } - - /** - * Sets running_count - * - * @param int|null $running_count Running task count - * - * @return self - */ - public function setRunningCount($running_count) - { - if (is_null($running_count)) { - throw new \InvalidArgumentException('non-nullable running_count cannot be null'); - } - $this->container['running_count'] = $running_count; - - return $this; - } - - /** - * Gets desired_count - * - * @return int|null + * @return string|null */ - public function getDesiredCount() + public function getMessage() { - return $this->container['desired_count']; + return $this->container['message']; } /** - * Sets desired_count + * Sets message * - * @param int|null $desired_count Desired task count + * @param string|null $message message * * @return self */ - public function setDesiredCount($desired_count) + public function setMessage($message) { - if (is_null($desired_count)) { - throw new \InvalidArgumentException('non-nullable desired_count cannot be null'); + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - $this->container['desired_count'] = $desired_count; + $this->container['message'] = $message; return $this; } diff --git a/src/Model/RestoreFilesystemRequest.php b/src/Model/RestoreFilesystemRequest.php new file mode 100644 index 00000000..81af782b --- /dev/null +++ b/src/Model/RestoreFilesystemRequest.php @@ -0,0 +1,449 @@ + + */ +class RestoreFilesystemRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'restoreFilesystem_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'backup_id' => 'string', + 'acknowledge_dataloss' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'backup_id' => null, + 'acknowledge_dataloss' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'backup_id' => false, + 'acknowledge_dataloss' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'backup_id' => 'backupId', + 'acknowledge_dataloss' => 'acknowledgeDataloss' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'backup_id' => 'setBackupId', + 'acknowledge_dataloss' => 'setAcknowledgeDataloss' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'backup_id' => 'getBackupId', + 'acknowledge_dataloss' => 'getAcknowledgeDataloss' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('backup_id', $data ?? [], null); + $this->setIfExists('acknowledge_dataloss', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['backup_id'] === null) { + $invalidProperties[] = "'backup_id' can't be null"; + } + if ($this->container['acknowledge_dataloss'] === null) { + $invalidProperties[] = "'acknowledge_dataloss' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets backup_id + * + * @return string + */ + public function getBackupId() + { + return $this->container['backup_id']; + } + + /** + * Sets backup_id + * + * @param string $backup_id The backup ID to restore (must match path param) + * + * @return self + */ + public function setBackupId($backup_id) + { + if (is_null($backup_id)) { + throw new \InvalidArgumentException('non-nullable backup_id cannot be null'); + } + $this->container['backup_id'] = $backup_id; + + return $this; + } + + /** + * Gets acknowledge_dataloss + * + * @return bool + */ + public function getAcknowledgeDataloss() + { + return $this->container['acknowledge_dataloss']; + } + + /** + * Sets acknowledge_dataloss + * + * @param bool $acknowledge_dataloss Must be true. tar extraction overwrites same-named files in the target EFS in place; pre-existing files not in the archive are preserved. + * + * @return self + */ + public function setAcknowledgeDataloss($acknowledge_dataloss) + { + if (is_null($acknowledge_dataloss)) { + throw new \InvalidArgumentException('non-nullable acknowledge_dataloss cannot be null'); + } + $this->container['acknowledge_dataloss'] = $acknowledge_dataloss; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ScalingPolicyListResponse.php b/src/Model/ScalingPolicyListResponse.php new file mode 100644 index 00000000..bf797f8e --- /dev/null +++ b/src/Model/ScalingPolicyListResponse.php @@ -0,0 +1,409 @@ + + */ +class ScalingPolicyListResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ScalingPolicyListResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'policies' => '\QuantClient\Model\GetScalingPolicyResponse[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'policies' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'policies' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'policies' => 'policies' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'policies' => 'setPolicies' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'policies' => 'getPolicies' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('policies', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets policies + * + * @return \QuantClient\Model\GetScalingPolicyResponse[]|null + */ + public function getPolicies() + { + return $this->container['policies']; + } + + /** + * Sets policies + * + * @param \QuantClient\Model\GetScalingPolicyResponse[]|null $policies policies + * + * @return self + */ + public function setPolicies($policies) + { + if (is_null($policies)) { + throw new \InvalidArgumentException('non-nullable policies cannot be null'); + } + $this->container['policies'] = $policies; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SearchSlackWorkspaceChannels200Response.php b/src/Model/SearchSlackWorkspaceChannels200Response.php new file mode 100644 index 00000000..39750290 --- /dev/null +++ b/src/Model/SearchSlackWorkspaceChannels200Response.php @@ -0,0 +1,409 @@ + + */ +class SearchSlackWorkspaceChannels200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchSlackWorkspaceChannels_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\QuantClient\Model\SearchSlackWorkspaceChannels200ResponseResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets results + * + * @return \QuantClient\Model\SearchSlackWorkspaceChannels200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \QuantClient\Model\SearchSlackWorkspaceChannels200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SearchSlackWorkspaceChannels200ResponseResultsInner.php b/src/Model/SearchSlackWorkspaceChannels200ResponseResultsInner.php new file mode 100644 index 00000000..151a8a4a --- /dev/null +++ b/src/Model/SearchSlackWorkspaceChannels200ResponseResultsInner.php @@ -0,0 +1,443 @@ + + */ +class SearchSlackWorkspaceChannels200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchSlackWorkspaceChannels_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SearchSlackWorkspaceUsers200Response.php b/src/Model/SearchSlackWorkspaceUsers200Response.php new file mode 100644 index 00000000..6b933a4e --- /dev/null +++ b/src/Model/SearchSlackWorkspaceUsers200Response.php @@ -0,0 +1,409 @@ + + */ +class SearchSlackWorkspaceUsers200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchSlackWorkspaceUsers_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\QuantClient\Model\SearchSlackWorkspaceUsers200ResponseResultsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets results + * + * @return \QuantClient\Model\SearchSlackWorkspaceUsers200ResponseResultsInner[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \QuantClient\Model\SearchSlackWorkspaceUsers200ResponseResultsInner[]|null $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SearchSlackWorkspaceUsers200ResponseResultsInner.php b/src/Model/SearchSlackWorkspaceUsers200ResponseResultsInner.php new file mode 100644 index 00000000..d2ce7c29 --- /dev/null +++ b/src/Model/SearchSlackWorkspaceUsers200ResponseResultsInner.php @@ -0,0 +1,477 @@ + + */ +class SearchSlackWorkspaceUsers200ResponseResultsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchSlackWorkspaceUsers_200_response_results_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'real_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'real_name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'real_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'real_name' => 'real_name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'real_name' => 'setRealName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'real_name' => 'getRealName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('real_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets real_name + * + * @return string|null + */ + public function getRealName() + { + return $this->container['real_name']; + } + + /** + * Sets real_name + * + * @param string|null $real_name real_name + * + * @return self + */ + public function setRealName($real_name) + { + if (is_null($real_name)) { + throw new \InvalidArgumentException('non-nullable real_name cannot be null'); + } + $this->container['real_name'] = $real_name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/ScalingPolicy.php b/src/Model/SetScalingPolicyRequest.php similarity index 92% rename from src/Model/ScalingPolicy.php rename to src/Model/SetScalingPolicyRequest.php index c9c6ae24..79c9e3df 100644 --- a/src/Model/ScalingPolicy.php +++ b/src/Model/SetScalingPolicyRequest.php @@ -1,6 +1,6 @@ */ -class ScalingPolicy implements ModelInterface, ArrayAccess, \JsonSerializable +class SetScalingPolicyRequest implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class ScalingPolicy implements ModelInterface, ArrayAccess, \JsonSerializable * * @var string */ - protected static $openAPIModelName = 'ScalingPolicy'; + protected static $openAPIModelName = 'SetScalingPolicyRequest'; /** * Array of property to type mappings. Used for (de)serialization @@ -72,7 +72,7 @@ class ScalingPolicy implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'metric' => null, - 'target_value' => null, + 'target_value' => 'double', 'scale_in_cooldown_seconds' => null, 'scale_out_cooldown_seconds' => null ]; @@ -281,8 +281,8 @@ public function __construct(?array $data = null) { $this->setIfExists('metric', $data ?? [], null); $this->setIfExists('target_value', $data ?? [], null); - $this->setIfExists('scale_in_cooldown_seconds', $data ?? [], null); - $this->setIfExists('scale_out_cooldown_seconds', $data ?? [], null); + $this->setIfExists('scale_in_cooldown_seconds', $data ?? [], 300); + $this->setIfExists('scale_out_cooldown_seconds', $data ?? [], 60); } /** @@ -312,6 +312,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['metric'] === null) { + $invalidProperties[] = "'metric' can't be null"; + } $allowedValues = $this->getMetricAllowableValues(); if (!is_null($this->container['metric']) && !in_array($this->container['metric'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -321,6 +324,9 @@ public function listInvalidProperties() ); } + if ($this->container['target_value'] === null) { + $invalidProperties[] = "'target_value' can't be null"; + } return $invalidProperties; } @@ -339,7 +345,7 @@ public function valid() /** * Gets metric * - * @return string|null + * @return string */ public function getMetric() { @@ -349,7 +355,7 @@ public function getMetric() /** * Sets metric * - * @param string|null $metric metric + * @param string $metric Metric to track for scaling. * * @return self */ @@ -376,7 +382,7 @@ public function setMetric($metric) /** * Gets target_value * - * @return float|null + * @return float */ public function getTargetValue() { @@ -386,7 +392,7 @@ public function getTargetValue() /** * Sets target_value * - * @param float|null $target_value target_value + * @param float $target_value Target value. Percentage for CPU/Memory; req/sec per task for RPS. * * @return self */ @@ -413,7 +419,7 @@ public function getScaleInCooldownSeconds() /** * Sets scale_in_cooldown_seconds * - * @param int|null $scale_in_cooldown_seconds scale_in_cooldown_seconds + * @param int|null $scale_in_cooldown_seconds Cooldown (seconds) before another scale-in can start. * * @return self */ @@ -440,7 +446,7 @@ public function getScaleOutCooldownSeconds() /** * Sets scale_out_cooldown_seconds * - * @param int|null $scale_out_cooldown_seconds scale_out_cooldown_seconds + * @param int|null $scale_out_cooldown_seconds Cooldown (seconds) before another scale-out can start. * * @return self */ diff --git a/src/Model/SpotConfiguration.php b/src/Model/SpotConfiguration.php index 178bad11..e8a403a2 100644 --- a/src/Model/SpotConfiguration.php +++ b/src/Model/SpotConfiguration.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/SubmitToolCallback200Response.php b/src/Model/SubmitToolCallback200Response.php index b3a36c74..6dac1a93 100644 --- a/src/Model/SubmitToolCallback200Response.php +++ b/src/Model/SubmitToolCallback200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/SubmitToolCallbackRequest.php b/src/Model/SubmitToolCallbackRequest.php index e70f37c8..b7e54684 100644 --- a/src/Model/SubmitToolCallbackRequest.php +++ b/src/Model/SubmitToolCallbackRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/SubmitToolCallbackRequestToolResultsInner.php b/src/Model/SubmitToolCallbackRequestToolResultsInner.php index 617438b0..24432d81 100644 --- a/src/Model/SubmitToolCallbackRequestToolResultsInner.php +++ b/src/Model/SubmitToolCallbackRequestToolResultsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/SyncOperation.php b/src/Model/SyncOperation.php index da9f8a85..d5aca3e9 100644 --- a/src/Model/SyncOperation.php +++ b/src/Model/SyncOperation.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/SyncSkillCollection200Response.php b/src/Model/SyncSkillCollection200Response.php new file mode 100644 index 00000000..3461e254 --- /dev/null +++ b/src/Model/SyncSkillCollection200Response.php @@ -0,0 +1,579 @@ + + */ +class SyncSkillCollection200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'syncSkillCollection_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'namespace' => 'string', + 'synced' => 'int', + 'created' => 'int', + 'failed' => 'int', + 'removed_from_source' => 'string[]', + 'skills' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'namespace' => null, + 'synced' => null, + 'created' => null, + 'failed' => null, + 'removed_from_source' => null, + 'skills' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'namespace' => false, + 'synced' => false, + 'created' => false, + 'failed' => false, + 'removed_from_source' => false, + 'skills' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'namespace' => 'namespace', + 'synced' => 'synced', + 'created' => 'created', + 'failed' => 'failed', + 'removed_from_source' => 'removedFromSource', + 'skills' => 'skills' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'namespace' => 'setNamespace', + 'synced' => 'setSynced', + 'created' => 'setCreated', + 'failed' => 'setFailed', + 'removed_from_source' => 'setRemovedFromSource', + 'skills' => 'setSkills' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'namespace' => 'getNamespace', + 'synced' => 'getSynced', + 'created' => 'getCreated', + 'failed' => 'getFailed', + 'removed_from_source' => 'getRemovedFromSource', + 'skills' => 'getSkills' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('namespace', $data ?? [], null); + $this->setIfExists('synced', $data ?? [], null); + $this->setIfExists('created', $data ?? [], null); + $this->setIfExists('failed', $data ?? [], null); + $this->setIfExists('removed_from_source', $data ?? [], null); + $this->setIfExists('skills', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets namespace + * + * @return string|null + */ + public function getNamespace() + { + return $this->container['namespace']; + } + + /** + * Sets namespace + * + * @param string|null $namespace namespace + * + * @return self + */ + public function setNamespace($namespace) + { + if (is_null($namespace)) { + throw new \InvalidArgumentException('non-nullable namespace cannot be null'); + } + $this->container['namespace'] = $namespace; + + return $this; + } + + /** + * Gets synced + * + * @return int|null + */ + public function getSynced() + { + return $this->container['synced']; + } + + /** + * Sets synced + * + * @param int|null $synced synced + * + * @return self + */ + public function setSynced($synced) + { + if (is_null($synced)) { + throw new \InvalidArgumentException('non-nullable synced cannot be null'); + } + $this->container['synced'] = $synced; + + return $this; + } + + /** + * Gets created + * + * @return int|null + */ + public function getCreated() + { + return $this->container['created']; + } + + /** + * Sets created + * + * @param int|null $created created + * + * @return self + */ + public function setCreated($created) + { + if (is_null($created)) { + throw new \InvalidArgumentException('non-nullable created cannot be null'); + } + $this->container['created'] = $created; + + return $this; + } + + /** + * Gets failed + * + * @return int|null + */ + public function getFailed() + { + return $this->container['failed']; + } + + /** + * Sets failed + * + * @param int|null $failed failed + * + * @return self + */ + public function setFailed($failed) + { + if (is_null($failed)) { + throw new \InvalidArgumentException('non-nullable failed cannot be null'); + } + $this->container['failed'] = $failed; + + return $this; + } + + /** + * Gets removed_from_source + * + * @return string[]|null + */ + public function getRemovedFromSource() + { + return $this->container['removed_from_source']; + } + + /** + * Sets removed_from_source + * + * @param string[]|null $removed_from_source removed_from_source + * + * @return self + */ + public function setRemovedFromSource($removed_from_source) + { + if (is_null($removed_from_source)) { + throw new \InvalidArgumentException('non-nullable removed_from_source cannot be null'); + } + $this->container['removed_from_source'] = $removed_from_source; + + return $this; + } + + /** + * Gets skills + * + * @return object[]|null + */ + public function getSkills() + { + return $this->container['skills']; + } + + /** + * Sets skills + * + * @param object[]|null $skills skills + * + * @return self + */ + public function setSkills($skills) + { + if (is_null($skills)) { + throw new \InvalidArgumentException('non-nullable skills cannot be null'); + } + $this->container['skills'] = $skills; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/SyncToEnvironmentRequest.php b/src/Model/SyncToEnvironmentRequest.php index f518b340..672c6dbc 100644 --- a/src/Model/SyncToEnvironmentRequest.php +++ b/src/Model/SyncToEnvironmentRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/TokensCreate201Response.php b/src/Model/TokensCreate201Response.php new file mode 100644 index 00000000..bc134a2f --- /dev/null +++ b/src/Model/TokensCreate201Response.php @@ -0,0 +1,675 @@ + + */ +class TokensCreate201Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Tokens_create_201_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'token' => 'string', + 'id' => 'int', + 'name' => 'string', + 'scopes' => 'string[]', + 'projects' => 'int[]', + 'preset' => 'string', + 'expires_at' => '\DateTime', + 'created_at' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'token' => null, + 'id' => null, + 'name' => null, + 'scopes' => null, + 'projects' => null, + 'preset' => null, + 'expires_at' => 'date-time', + 'created_at' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'token' => false, + 'id' => false, + 'name' => false, + 'scopes' => true, + 'projects' => true, + 'preset' => true, + 'expires_at' => true, + 'created_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'token' => 'token', + 'id' => 'id', + 'name' => 'name', + 'scopes' => 'scopes', + 'projects' => 'projects', + 'preset' => 'preset', + 'expires_at' => 'expires_at', + 'created_at' => 'created_at' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'token' => 'setToken', + 'id' => 'setId', + 'name' => 'setName', + 'scopes' => 'setScopes', + 'projects' => 'setProjects', + 'preset' => 'setPreset', + 'expires_at' => 'setExpiresAt', + 'created_at' => 'setCreatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'token' => 'getToken', + 'id' => 'getId', + 'name' => 'getName', + 'scopes' => 'getScopes', + 'projects' => 'getProjects', + 'preset' => 'getPreset', + 'expires_at' => 'getExpiresAt', + 'created_at' => 'getCreatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('token', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('scopes', $data ?? [], null); + $this->setIfExists('projects', $data ?? [], null); + $this->setIfExists('preset', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets token + * + * @return string|null + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param string|null $token The plain text token (shown once) + * + * @return self + */ + public function setToken($token) + { + if (is_null($token)) { + throw new \InvalidArgumentException('non-nullable token cannot be null'); + } + $this->container['token'] = $token; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id Token ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets scopes + * + * @return string[]|null + */ + public function getScopes() + { + return $this->container['scopes']; + } + + /** + * Sets scopes + * + * @param string[]|null $scopes scopes + * + * @return self + */ + public function setScopes($scopes) + { + if (is_null($scopes)) { + array_push($this->openAPINullablesSetToNull, 'scopes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('scopes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['scopes'] = $scopes; + + return $this; + } + + /** + * Gets projects + * + * @return int[]|null + */ + public function getProjects() + { + return $this->container['projects']; + } + + /** + * Sets projects + * + * @param int[]|null $projects projects + * + * @return self + */ + public function setProjects($projects) + { + if (is_null($projects)) { + array_push($this->openAPINullablesSetToNull, 'projects'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('projects', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['projects'] = $projects; + + return $this; + } + + /** + * Gets preset + * + * @return string|null + */ + public function getPreset() + { + return $this->container['preset']; + } + + /** + * Sets preset + * + * @param string|null $preset preset + * + * @return self + */ + public function setPreset($preset) + { + if (is_null($preset)) { + array_push($this->openAPINullablesSetToNull, 'preset'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('preset', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['preset'] = $preset; + + return $this; + } + + /** + * Gets expires_at + * + * @return \DateTime|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param \DateTime|null $expires_at expires_at + * + * @return self + */ + public function setExpiresAt($expires_at) + { + if (is_null($expires_at)) { + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime|null $created_at created_at + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TokensCreateRequest.php b/src/Model/TokensCreateRequest.php new file mode 100644 index 00000000..6ca3e792 --- /dev/null +++ b/src/Model/TokensCreateRequest.php @@ -0,0 +1,614 @@ + + */ +class TokensCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Tokens_create_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'preset' => 'string', + 'scopes' => 'string[]', + 'projects' => 'int[]', + 'expires_in' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'preset' => null, + 'scopes' => null, + 'projects' => null, + 'expires_in' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'preset' => true, + 'scopes' => true, + 'projects' => true, + 'expires_in' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'preset' => 'preset', + 'scopes' => 'scopes', + 'projects' => 'projects', + 'expires_in' => 'expires_in' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'preset' => 'setPreset', + 'scopes' => 'setScopes', + 'projects' => 'setProjects', + 'expires_in' => 'setExpiresIn' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'preset' => 'getPreset', + 'scopes' => 'getScopes', + 'projects' => 'getProjects', + 'expires_in' => 'getExpiresIn' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const EXPIRES_IN__30D = '30d'; + public const EXPIRES_IN__90D = '90d'; + public const EXPIRES_IN__365D = '365d'; + public const EXPIRES_IN_NEVER = 'never'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExpiresInAllowableValues() + { + return [ + self::EXPIRES_IN__30D, + self::EXPIRES_IN__90D, + self::EXPIRES_IN__365D, + self::EXPIRES_IN_NEVER, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('preset', $data ?? [], null); + $this->setIfExists('scopes', $data ?? [], null); + $this->setIfExists('projects', $data ?? [], null); + $this->setIfExists('expires_in', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + $allowedValues = $this->getExpiresInAllowableValues(); + if (!is_null($this->container['expires_in']) && !in_array($this->container['expires_in'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'expires_in', must be one of '%s'", + $this->container['expires_in'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name for the token + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets preset + * + * @return string|null + */ + public function getPreset() + { + return $this->container['preset']; + } + + /** + * Sets preset + * + * @param string|null $preset Preset scope bundle + * + * @return self + */ + public function setPreset($preset) + { + if (is_null($preset)) { + array_push($this->openAPINullablesSetToNull, 'preset'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('preset', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['preset'] = $preset; + + return $this; + } + + /** + * Gets scopes + * + * @return string[]|null + */ + public function getScopes() + { + return $this->container['scopes']; + } + + /** + * Sets scopes + * + * @param string[]|null $scopes Individual scopes (mutually exclusive with preset) + * + * @return self + */ + public function setScopes($scopes) + { + if (is_null($scopes)) { + array_push($this->openAPINullablesSetToNull, 'scopes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('scopes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['scopes'] = $scopes; + + return $this; + } + + /** + * Gets projects + * + * @return int[]|null + */ + public function getProjects() + { + return $this->container['projects']; + } + + /** + * Sets projects + * + * @param int[]|null $projects Project IDs to restrict this token to + * + * @return self + */ + public function setProjects($projects) + { + if (is_null($projects)) { + array_push($this->openAPINullablesSetToNull, 'projects'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('projects', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['projects'] = $projects; + + return $this; + } + + /** + * Gets expires_in + * + * @return string|null + */ + public function getExpiresIn() + { + return $this->container['expires_in']; + } + + /** + * Sets expires_in + * + * @param string|null $expires_in Token expiration period + * + * @return self + */ + public function setExpiresIn($expires_in) + { + if (is_null($expires_in)) { + array_push($this->openAPINullablesSetToNull, 'expires_in'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_in', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $allowedValues = $this->getExpiresInAllowableValues(); + if (!is_null($expires_in) && !in_array($expires_in, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'expires_in', must be one of '%s'", + $expires_in, + implode("', '", $allowedValues) + ) + ); + } + $this->container['expires_in'] = $expires_in; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TokensDelete200Response.php b/src/Model/TokensDelete200Response.php new file mode 100644 index 00000000..9973c1de --- /dev/null +++ b/src/Model/TokensDelete200Response.php @@ -0,0 +1,409 @@ + + */ +class TokensDelete200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Tokens_delete_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/TokensList200ResponseInner.php b/src/Model/TokensList200ResponseInner.php new file mode 100644 index 00000000..c588f3a3 --- /dev/null +++ b/src/Model/TokensList200ResponseInner.php @@ -0,0 +1,518 @@ + + */ +class TokensList200ResponseInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Tokens_list_200_response_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'last_used' => '\DateTime', + 'created_at' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'last_used' => 'date-time', + 'created_at' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'last_used' => true, + 'created_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'last_used' => 'last_used', + 'created_at' => 'created_at' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'last_used' => 'setLastUsed', + 'created_at' => 'setCreatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'last_used' => 'getLastUsed', + 'created_at' => 'getCreatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('last_used', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets last_used + * + * @return \DateTime|null + */ + public function getLastUsed() + { + return $this->container['last_used']; + } + + /** + * Sets last_used + * + * @param \DateTime|null $last_used last_used + * + * @return self + */ + public function setLastUsed($last_used) + { + if (is_null($last_used)) { + array_push($this->openAPINullablesSetToNull, 'last_used'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('last_used', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['last_used'] = $last_used; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime|null $created_at created_at + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UpdateAIAgent200Response.php b/src/Model/UpdateAIAgent200Response.php index 23d7a0df..600d7988 100644 --- a/src/Model/UpdateAIAgent200Response.php +++ b/src/Model/UpdateAIAgent200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/UpdateAIAgentRequest.php b/src/Model/UpdateAIAgentRequest.php index 534f2109..fb4141d1 100644 --- a/src/Model/UpdateAIAgentRequest.php +++ b/src/Model/UpdateAIAgentRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -65,7 +65,11 @@ class UpdateAIAgentRequest implements ModelInterface, ArrayAccess, \JsonSerializ 'model_id' => 'string', 'max_tokens' => 'int', 'allowed_tools' => 'string[]', - 'allowed_collections' => 'string[]' + 'allowed_collections' => 'string[]', + 'assigned_skills' => 'string[]', + 'long_context' => 'bool', + 'guardrail_preset' => 'string', + 'filter_policies' => 'string[]' ]; /** @@ -84,7 +88,11 @@ class UpdateAIAgentRequest implements ModelInterface, ArrayAccess, \JsonSerializ 'model_id' => null, 'max_tokens' => null, 'allowed_tools' => null, - 'allowed_collections' => null + 'allowed_collections' => null, + 'assigned_skills' => null, + 'long_context' => null, + 'guardrail_preset' => null, + 'filter_policies' => null ]; /** @@ -101,7 +109,11 @@ class UpdateAIAgentRequest implements ModelInterface, ArrayAccess, \JsonSerializ 'model_id' => false, 'max_tokens' => false, 'allowed_tools' => false, - 'allowed_collections' => false + 'allowed_collections' => false, + 'assigned_skills' => false, + 'long_context' => false, + 'guardrail_preset' => true, + 'filter_policies' => false ]; /** @@ -198,7 +210,11 @@ public function isNullableSetToNull(string $property): bool 'model_id' => 'modelId', 'max_tokens' => 'maxTokens', 'allowed_tools' => 'allowedTools', - 'allowed_collections' => 'allowedCollections' + 'allowed_collections' => 'allowedCollections', + 'assigned_skills' => 'assignedSkills', + 'long_context' => 'longContext', + 'guardrail_preset' => 'guardrailPreset', + 'filter_policies' => 'filterPolicies' ]; /** @@ -215,7 +231,11 @@ public function isNullableSetToNull(string $property): bool 'model_id' => 'setModelId', 'max_tokens' => 'setMaxTokens', 'allowed_tools' => 'setAllowedTools', - 'allowed_collections' => 'setAllowedCollections' + 'allowed_collections' => 'setAllowedCollections', + 'assigned_skills' => 'setAssignedSkills', + 'long_context' => 'setLongContext', + 'guardrail_preset' => 'setGuardrailPreset', + 'filter_policies' => 'setFilterPolicies' ]; /** @@ -232,7 +252,11 @@ public function isNullableSetToNull(string $property): bool 'model_id' => 'getModelId', 'max_tokens' => 'getMaxTokens', 'allowed_tools' => 'getAllowedTools', - 'allowed_collections' => 'getAllowedCollections' + 'allowed_collections' => 'getAllowedCollections', + 'assigned_skills' => 'getAssignedSkills', + 'long_context' => 'getLongContext', + 'guardrail_preset' => 'getGuardrailPreset', + 'filter_policies' => 'getFilterPolicies' ]; /** @@ -276,6 +300,23 @@ public function getModelName() return self::$openAPIModelName; } + public const GUARDRAIL_PRESET_OFFICIAL = 'official'; + public const GUARDRAIL_PRESET_OFFICIAL_SENSITIVE = 'official-sensitive'; + public const GUARDRAIL_PRESET__PROTECTED = 'protected'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getGuardrailPresetAllowableValues() + { + return [ + self::GUARDRAIL_PRESET_OFFICIAL, + self::GUARDRAIL_PRESET_OFFICIAL_SENSITIVE, + self::GUARDRAIL_PRESET__PROTECTED, + ]; + } /** * Associative array for storing property values @@ -301,6 +342,10 @@ public function __construct(?array $data = null) $this->setIfExists('max_tokens', $data ?? [], null); $this->setIfExists('allowed_tools', $data ?? [], null); $this->setIfExists('allowed_collections', $data ?? [], null); + $this->setIfExists('assigned_skills', $data ?? [], null); + $this->setIfExists('long_context', $data ?? [], null); + $this->setIfExists('guardrail_preset', $data ?? [], null); + $this->setIfExists('filter_policies', $data ?? [], null); } /** @@ -346,6 +391,15 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'max_tokens', must be bigger than or equal to 1."; } + $allowedValues = $this->getGuardrailPresetAllowableValues(); + if (!is_null($this->container['guardrail_preset']) && !in_array($this->container['guardrail_preset'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'guardrail_preset', must be one of '%s'", + $this->container['guardrail_preset'], + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -619,6 +673,131 @@ public function setAllowedCollections($allowed_collections) return $this; } + + /** + * Gets assigned_skills + * + * @return string[]|null + */ + public function getAssignedSkills() + { + return $this->container['assigned_skills']; + } + + /** + * Sets assigned_skills + * + * @param string[]|null $assigned_skills Skill IDs to assign to this agent + * + * @return self + */ + public function setAssignedSkills($assigned_skills) + { + if (is_null($assigned_skills)) { + throw new \InvalidArgumentException('non-nullable assigned_skills cannot be null'); + } + $this->container['assigned_skills'] = $assigned_skills; + + return $this; + } + + /** + * Gets long_context + * + * @return bool|null + */ + public function getLongContext() + { + return $this->container['long_context']; + } + + /** + * Sets long_context + * + * @param bool|null $long_context Enable 1M context window support + * + * @return self + */ + public function setLongContext($long_context) + { + if (is_null($long_context)) { + throw new \InvalidArgumentException('non-nullable long_context cannot be null'); + } + $this->container['long_context'] = $long_context; + + return $this; + } + + /** + * Gets guardrail_preset + * + * @return string|null + */ + public function getGuardrailPreset() + { + return $this->container['guardrail_preset']; + } + + /** + * Sets guardrail_preset + * + * @param string|null $guardrail_preset Guardrail preset name + * + * @return self + */ + public function setGuardrailPreset($guardrail_preset) + { + if (is_null($guardrail_preset)) { + array_push($this->openAPINullablesSetToNull, 'guardrail_preset'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('guardrail_preset', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $allowedValues = $this->getGuardrailPresetAllowableValues(); + if (!is_null($guardrail_preset) && !in_array($guardrail_preset, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'guardrail_preset', must be one of '%s'", + $guardrail_preset, + implode("', '", $allowedValues) + ) + ); + } + $this->container['guardrail_preset'] = $guardrail_preset; + + return $this; + } + + /** + * Gets filter_policies + * + * @return string[]|null + */ + public function getFilterPolicies() + { + return $this->container['filter_policies']; + } + + /** + * Sets filter_policies + * + * @param string[]|null $filter_policies Filter policy IDs to apply to this agent's inference requests + * + * @return self + */ + public function setFilterPolicies($filter_policies) + { + if (is_null($filter_policies)) { + throw new \InvalidArgumentException('non-nullable filter_policies cannot be null'); + } + $this->container['filter_policies'] = $filter_policies; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/UpdateAISession200Response.php b/src/Model/UpdateAISession200Response.php index e583541e..5c5294fa 100644 --- a/src/Model/UpdateAISession200Response.php +++ b/src/Model/UpdateAISession200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/UpdateAISessionRequest.php b/src/Model/UpdateAISessionRequest.php index d263327c..100e6f9e 100644 --- a/src/Model/UpdateAISessionRequest.php +++ b/src/Model/UpdateAISessionRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/UpdateAISessionRequestNewMessagesInner.php b/src/Model/UpdateAISessionRequestNewMessagesInner.php index 69988163..cad26759 100644 --- a/src/Model/UpdateAISessionRequestNewMessagesInner.php +++ b/src/Model/UpdateAISessionRequestNewMessagesInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/UpdateCronJobRequest.php b/src/Model/UpdateCronJobRequest.php index fba9c751..d7fb8a7c 100644 --- a/src/Model/UpdateCronJobRequest.php +++ b/src/Model/UpdateCronJobRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/UpdateEnvironmentRequest.php b/src/Model/UpdateEnvironmentRequest.php index 69b46f40..9849a928 100644 --- a/src/Model/UpdateEnvironmentRequest.php +++ b/src/Model/UpdateEnvironmentRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/UpdateEnvironmentStateRequest.php b/src/Model/UpdateEnvironmentStateRequest.php index c9045934..8e8fc8e9 100644 --- a/src/Model/UpdateEnvironmentStateRequest.php +++ b/src/Model/UpdateEnvironmentStateRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/UpdateEnvironmentVariableRequest.php b/src/Model/UpdateEnvironmentVariableRequest.php index 542d6718..950df7f0 100644 --- a/src/Model/UpdateEnvironmentVariableRequest.php +++ b/src/Model/UpdateEnvironmentVariableRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/UpdateFilterPolicyRequest.php b/src/Model/UpdateFilterPolicyRequest.php new file mode 100644 index 00000000..e1136c77 --- /dev/null +++ b/src/Model/UpdateFilterPolicyRequest.php @@ -0,0 +1,549 @@ + + */ +class UpdateFilterPolicyRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'updateFilterPolicy_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'description' => 'string', + 'enabled' => 'bool', + 'rules' => '\QuantClient\Model\CreateFilterPolicyRequestRulesInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'description' => null, + 'enabled' => null, + 'rules' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'description' => true, + 'enabled' => false, + 'rules' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'description' => 'description', + 'enabled' => 'enabled', + 'rules' => 'rules' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'enabled' => 'setEnabled', + 'rules' => 'setRules' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'enabled' => 'getEnabled', + 'rules' => 'getRules' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 255)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 1000)) { + $invalidProperties[] = "invalid value for 'description', the character length must be smaller than or equal to 1000."; + } + + if (!is_null($this->container['rules']) && (count($this->container['rules']) > 100)) { + $invalidProperties[] = "invalid value for 'rules', number of items must be less than or equal to 100."; + } + + if (!is_null($this->container['rules']) && (count($this->container['rules']) < 1)) { + $invalidProperties[] = "invalid value for 'rules', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + if ((mb_strlen($name) > 255)) { + throw new \InvalidArgumentException('invalid length for $name when calling UpdateFilterPolicyRequest., must be smaller than or equal to 255.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($description) && (mb_strlen($description) > 1000)) { + throw new \InvalidArgumentException('invalid length for $description when calling UpdateFilterPolicyRequest., must be smaller than or equal to 1000.'); + } + + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled enabled + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets rules + * + * @return \QuantClient\Model\CreateFilterPolicyRequestRulesInner[]|null + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \QuantClient\Model\CreateFilterPolicyRequestRulesInner[]|null $rules rules + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + throw new \InvalidArgumentException('non-nullable rules cannot be null'); + } + + if ((count($rules) > 100)) { + throw new \InvalidArgumentException('invalid value for $rules when calling UpdateFilterPolicyRequest., number of items must be less than or equal to 100.'); + } + if ((count($rules) < 1)) { + throw new \InvalidArgumentException('invalid length for $rules when calling UpdateFilterPolicyRequest., number of items must be greater than or equal to 1.'); + } + $this->container['rules'] = $rules; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UpdateGovernanceConfig200Response.php b/src/Model/UpdateGovernanceConfig200Response.php new file mode 100644 index 00000000..4d93865a --- /dev/null +++ b/src/Model/UpdateGovernanceConfig200Response.php @@ -0,0 +1,443 @@ + + */ +class UpdateGovernanceConfig200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'updateGovernanceConfig_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'success' => 'bool', + 'config' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'config' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'success' => false, + 'config' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'config' => 'config' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'config' => 'setConfig' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'config' => 'getConfig' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('success', $data ?? [], null); + $this->setIfExists('config', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success) + { + if (is_null($success)) { + throw new \InvalidArgumentException('non-nullable success cannot be null'); + } + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets config + * + * @return object|null + */ + public function getConfig() + { + return $this->container['config']; + } + + /** + * Sets config + * + * @param object|null $config config + * + * @return self + */ + public function setConfig($config) + { + if (is_null($config)) { + throw new \InvalidArgumentException('non-nullable config cannot be null'); + } + $this->container['config'] = $config; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UpdateGovernanceConfigRequest.php b/src/Model/UpdateGovernanceConfigRequest.php new file mode 100644 index 00000000..9ebcb998 --- /dev/null +++ b/src/Model/UpdateGovernanceConfigRequest.php @@ -0,0 +1,698 @@ + + */ +class UpdateGovernanceConfigRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'updateGovernanceConfig_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ai_enabled' => 'bool', + 'model_policy' => 'string', + 'model_list' => 'string[]', + 'mandatory_guardrail_preset' => 'string', + 'mandatory_filter_policies' => 'string[]', + 'spend_limits' => '\QuantClient\Model\GetGovernanceConfig200ResponseSpendLimits', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ai_enabled' => null, + 'model_policy' => null, + 'model_list' => null, + 'mandatory_guardrail_preset' => null, + 'mandatory_filter_policies' => null, + 'spend_limits' => null, + 'version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ai_enabled' => false, + 'model_policy' => false, + 'model_list' => false, + 'mandatory_guardrail_preset' => true, + 'mandatory_filter_policies' => false, + 'spend_limits' => false, + 'version' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ai_enabled' => 'aiEnabled', + 'model_policy' => 'modelPolicy', + 'model_list' => 'modelList', + 'mandatory_guardrail_preset' => 'mandatoryGuardrailPreset', + 'mandatory_filter_policies' => 'mandatoryFilterPolicies', + 'spend_limits' => 'spendLimits', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ai_enabled' => 'setAiEnabled', + 'model_policy' => 'setModelPolicy', + 'model_list' => 'setModelList', + 'mandatory_guardrail_preset' => 'setMandatoryGuardrailPreset', + 'mandatory_filter_policies' => 'setMandatoryFilterPolicies', + 'spend_limits' => 'setSpendLimits', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ai_enabled' => 'getAiEnabled', + 'model_policy' => 'getModelPolicy', + 'model_list' => 'getModelList', + 'mandatory_guardrail_preset' => 'getMandatoryGuardrailPreset', + 'mandatory_filter_policies' => 'getMandatoryFilterPolicies', + 'spend_limits' => 'getSpendLimits', + 'version' => 'getVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const MODEL_POLICY_UNRESTRICTED = 'unrestricted'; + public const MODEL_POLICY_ALLOWLIST = 'allowlist'; + public const MODEL_POLICY_BLOCKLIST = 'blocklist'; + public const MANDATORY_GUARDRAIL_PRESET_OFFICIAL = 'official'; + public const MANDATORY_GUARDRAIL_PRESET_OFFICIAL_SENSITIVE = 'official-sensitive'; + public const MANDATORY_GUARDRAIL_PRESET__PROTECTED = 'protected'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getModelPolicyAllowableValues() + { + return [ + self::MODEL_POLICY_UNRESTRICTED, + self::MODEL_POLICY_ALLOWLIST, + self::MODEL_POLICY_BLOCKLIST, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMandatoryGuardrailPresetAllowableValues() + { + return [ + self::MANDATORY_GUARDRAIL_PRESET_OFFICIAL, + self::MANDATORY_GUARDRAIL_PRESET_OFFICIAL_SENSITIVE, + self::MANDATORY_GUARDRAIL_PRESET__PROTECTED, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('ai_enabled', $data ?? [], null); + $this->setIfExists('model_policy', $data ?? [], null); + $this->setIfExists('model_list', $data ?? [], null); + $this->setIfExists('mandatory_guardrail_preset', $data ?? [], null); + $this->setIfExists('mandatory_filter_policies', $data ?? [], null); + $this->setIfExists('spend_limits', $data ?? [], null); + $this->setIfExists('version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ai_enabled'] === null) { + $invalidProperties[] = "'ai_enabled' can't be null"; + } + if ($this->container['model_policy'] === null) { + $invalidProperties[] = "'model_policy' can't be null"; + } + $allowedValues = $this->getModelPolicyAllowableValues(); + if (!is_null($this->container['model_policy']) && !in_array($this->container['model_policy'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'model_policy', must be one of '%s'", + $this->container['model_policy'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getMandatoryGuardrailPresetAllowableValues(); + if (!is_null($this->container['mandatory_guardrail_preset']) && !in_array($this->container['mandatory_guardrail_preset'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'mandatory_guardrail_preset', must be one of '%s'", + $this->container['mandatory_guardrail_preset'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets ai_enabled + * + * @return bool + */ + public function getAiEnabled() + { + return $this->container['ai_enabled']; + } + + /** + * Sets ai_enabled + * + * @param bool $ai_enabled ai_enabled + * + * @return self + */ + public function setAiEnabled($ai_enabled) + { + if (is_null($ai_enabled)) { + throw new \InvalidArgumentException('non-nullable ai_enabled cannot be null'); + } + $this->container['ai_enabled'] = $ai_enabled; + + return $this; + } + + /** + * Gets model_policy + * + * @return string + */ + public function getModelPolicy() + { + return $this->container['model_policy']; + } + + /** + * Sets model_policy + * + * @param string $model_policy model_policy + * + * @return self + */ + public function setModelPolicy($model_policy) + { + if (is_null($model_policy)) { + throw new \InvalidArgumentException('non-nullable model_policy cannot be null'); + } + $allowedValues = $this->getModelPolicyAllowableValues(); + if (!in_array($model_policy, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'model_policy', must be one of '%s'", + $model_policy, + implode("', '", $allowedValues) + ) + ); + } + $this->container['model_policy'] = $model_policy; + + return $this; + } + + /** + * Gets model_list + * + * @return string[]|null + */ + public function getModelList() + { + return $this->container['model_list']; + } + + /** + * Sets model_list + * + * @param string[]|null $model_list model_list + * + * @return self + */ + public function setModelList($model_list) + { + if (is_null($model_list)) { + throw new \InvalidArgumentException('non-nullable model_list cannot be null'); + } + $this->container['model_list'] = $model_list; + + return $this; + } + + /** + * Gets mandatory_guardrail_preset + * + * @return string|null + */ + public function getMandatoryGuardrailPreset() + { + return $this->container['mandatory_guardrail_preset']; + } + + /** + * Sets mandatory_guardrail_preset + * + * @param string|null $mandatory_guardrail_preset mandatory_guardrail_preset + * + * @return self + */ + public function setMandatoryGuardrailPreset($mandatory_guardrail_preset) + { + if (is_null($mandatory_guardrail_preset)) { + array_push($this->openAPINullablesSetToNull, 'mandatory_guardrail_preset'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mandatory_guardrail_preset', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $allowedValues = $this->getMandatoryGuardrailPresetAllowableValues(); + if (!is_null($mandatory_guardrail_preset) && !in_array($mandatory_guardrail_preset, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'mandatory_guardrail_preset', must be one of '%s'", + $mandatory_guardrail_preset, + implode("', '", $allowedValues) + ) + ); + } + $this->container['mandatory_guardrail_preset'] = $mandatory_guardrail_preset; + + return $this; + } + + /** + * Gets mandatory_filter_policies + * + * @return string[]|null + */ + public function getMandatoryFilterPolicies() + { + return $this->container['mandatory_filter_policies']; + } + + /** + * Sets mandatory_filter_policies + * + * @param string[]|null $mandatory_filter_policies mandatory_filter_policies + * + * @return self + */ + public function setMandatoryFilterPolicies($mandatory_filter_policies) + { + if (is_null($mandatory_filter_policies)) { + throw new \InvalidArgumentException('non-nullable mandatory_filter_policies cannot be null'); + } + $this->container['mandatory_filter_policies'] = $mandatory_filter_policies; + + return $this; + } + + /** + * Gets spend_limits + * + * @return \QuantClient\Model\GetGovernanceConfig200ResponseSpendLimits|null + */ + public function getSpendLimits() + { + return $this->container['spend_limits']; + } + + /** + * Sets spend_limits + * + * @param \QuantClient\Model\GetGovernanceConfig200ResponseSpendLimits|null $spend_limits spend_limits + * + * @return self + */ + public function setSpendLimits($spend_limits) + { + if (is_null($spend_limits)) { + throw new \InvalidArgumentException('non-nullable spend_limits cannot be null'); + } + $this->container['spend_limits'] = $spend_limits; + + return $this; + } + + /** + * Gets version + * + * @return int|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int|null $version version + * + * @return self + */ + public function setVersion($version) + { + if (is_null($version)) { + throw new \InvalidArgumentException('non-nullable version cannot be null'); + } + $this->container['version'] = $version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UpdateSkill200Response.php b/src/Model/UpdateSkill200Response.php new file mode 100644 index 00000000..af9d4563 --- /dev/null +++ b/src/Model/UpdateSkill200Response.php @@ -0,0 +1,477 @@ + + */ +class UpdateSkill200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'updateSkill_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'success' => 'bool', + 'skill' => 'object', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'skill' => null, + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'success' => false, + 'skill' => false, + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'skill' => 'skill', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'skill' => 'setSkill', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'skill' => 'getSkill', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('success', $data ?? [], null); + $this->setIfExists('skill', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success) + { + if (is_null($success)) { + throw new \InvalidArgumentException('non-nullable success cannot be null'); + } + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets skill + * + * @return object|null + */ + public function getSkill() + { + return $this->container['skill']; + } + + /** + * Sets skill + * + * @param object|null $skill skill + * + * @return self + */ + public function setSkill($skill) + { + if (is_null($skill)) { + throw new \InvalidArgumentException('non-nullable skill cannot be null'); + } + $this->container['skill'] = $skill; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UpdateSkillRequest.php b/src/Model/UpdateSkillRequest.php new file mode 100644 index 00000000..82517b56 --- /dev/null +++ b/src/Model/UpdateSkillRequest.php @@ -0,0 +1,749 @@ + + */ +class UpdateSkillRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'updateSkill_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'description' => 'string', + 'content' => 'string', + 'trigger_condition' => 'string', + 'tags' => 'string[]', + 'required_tools' => 'string[]', + 'source' => 'object', + 'files' => 'object', + 'disable_model_invocation' => 'bool', + 'allowed_tools' => 'string[]', + 'namespace' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'description' => null, + 'content' => null, + 'trigger_condition' => null, + 'tags' => null, + 'required_tools' => null, + 'source' => null, + 'files' => null, + 'disable_model_invocation' => null, + 'allowed_tools' => null, + 'namespace' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'description' => false, + 'content' => false, + 'trigger_condition' => false, + 'tags' => false, + 'required_tools' => false, + 'source' => false, + 'files' => false, + 'disable_model_invocation' => false, + 'allowed_tools' => false, + 'namespace' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'description' => 'description', + 'content' => 'content', + 'trigger_condition' => 'triggerCondition', + 'tags' => 'tags', + 'required_tools' => 'requiredTools', + 'source' => 'source', + 'files' => 'files', + 'disable_model_invocation' => 'disableModelInvocation', + 'allowed_tools' => 'allowedTools', + 'namespace' => 'namespace' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'content' => 'setContent', + 'trigger_condition' => 'setTriggerCondition', + 'tags' => 'setTags', + 'required_tools' => 'setRequiredTools', + 'source' => 'setSource', + 'files' => 'setFiles', + 'disable_model_invocation' => 'setDisableModelInvocation', + 'allowed_tools' => 'setAllowedTools', + 'namespace' => 'setNamespace' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'content' => 'getContent', + 'trigger_condition' => 'getTriggerCondition', + 'tags' => 'getTags', + 'required_tools' => 'getRequiredTools', + 'source' => 'getSource', + 'files' => 'getFiles', + 'disable_model_invocation' => 'getDisableModelInvocation', + 'allowed_tools' => 'getAllowedTools', + 'namespace' => 'getNamespace' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('trigger_condition', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('required_tools', $data ?? [], null); + $this->setIfExists('source', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('disable_model_invocation', $data ?? [], null); + $this->setIfExists('allowed_tools', $data ?? [], null); + $this->setIfExists('namespace', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content content + * + * @return self + */ + public function setContent($content) + { + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets trigger_condition + * + * @return string|null + */ + public function getTriggerCondition() + { + return $this->container['trigger_condition']; + } + + /** + * Sets trigger_condition + * + * @param string|null $trigger_condition trigger_condition + * + * @return self + */ + public function setTriggerCondition($trigger_condition) + { + if (is_null($trigger_condition)) { + throw new \InvalidArgumentException('non-nullable trigger_condition cannot be null'); + } + $this->container['trigger_condition'] = $trigger_condition; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return self + */ + public function setTags($tags) + { + if (is_null($tags)) { + throw new \InvalidArgumentException('non-nullable tags cannot be null'); + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets required_tools + * + * @return string[]|null + */ + public function getRequiredTools() + { + return $this->container['required_tools']; + } + + /** + * Sets required_tools + * + * @param string[]|null $required_tools required_tools + * + * @return self + */ + public function setRequiredTools($required_tools) + { + if (is_null($required_tools)) { + throw new \InvalidArgumentException('non-nullable required_tools cannot be null'); + } + $this->container['required_tools'] = $required_tools; + + return $this; + } + + /** + * Gets source + * + * @return object|null + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param object|null $source source + * + * @return self + */ + public function setSource($source) + { + if (is_null($source)) { + throw new \InvalidArgumentException('non-nullable source cannot be null'); + } + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets files + * + * @return object|null + */ + public function getFiles() + { + return $this->container['files']; + } + + /** + * Sets files + * + * @param object|null $files files + * + * @return self + */ + public function setFiles($files) + { + if (is_null($files)) { + throw new \InvalidArgumentException('non-nullable files cannot be null'); + } + $this->container['files'] = $files; + + return $this; + } + + /** + * Gets disable_model_invocation + * + * @return bool|null + */ + public function getDisableModelInvocation() + { + return $this->container['disable_model_invocation']; + } + + /** + * Sets disable_model_invocation + * + * @param bool|null $disable_model_invocation disable_model_invocation + * + * @return self + */ + public function setDisableModelInvocation($disable_model_invocation) + { + if (is_null($disable_model_invocation)) { + throw new \InvalidArgumentException('non-nullable disable_model_invocation cannot be null'); + } + $this->container['disable_model_invocation'] = $disable_model_invocation; + + return $this; + } + + /** + * Gets allowed_tools + * + * @return string[]|null + */ + public function getAllowedTools() + { + return $this->container['allowed_tools']; + } + + /** + * Sets allowed_tools + * + * @param string[]|null $allowed_tools allowed_tools + * + * @return self + */ + public function setAllowedTools($allowed_tools) + { + if (is_null($allowed_tools)) { + throw new \InvalidArgumentException('non-nullable allowed_tools cannot be null'); + } + $this->container['allowed_tools'] = $allowed_tools; + + return $this; + } + + /** + * Gets namespace + * + * @return string|null + */ + public function getNamespace() + { + return $this->container['namespace']; + } + + /** + * Sets namespace + * + * @param string|null $namespace namespace + * + * @return self + */ + public function setNamespace($namespace) + { + if (is_null($namespace)) { + throw new \InvalidArgumentException('non-nullable namespace cannot be null'); + } + $this->container['namespace'] = $namespace; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UpdateSlackBotRequest.php b/src/Model/UpdateSlackBotRequest.php new file mode 100644 index 00000000..d438c7de --- /dev/null +++ b/src/Model/UpdateSlackBotRequest.php @@ -0,0 +1,1198 @@ + + */ +class UpdateSlackBotRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'updateSlackBot_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'status' => 'string', + 'system_prompt' => 'string', + 'model_id' => 'string', + 'temperature' => 'float', + 'max_tokens' => 'int', + 'allowed_tools' => 'string[]', + 'assigned_skills' => 'string[]', + 'allowed_collections' => 'string[]', + 'allowed_sub_agents' => 'string[]', + 'guardrail_preset' => 'string', + 'filter_policies' => 'string[]', + 'long_context' => 'bool', + 'session_ttl_days' => 'int', + 'allowed_channels' => 'string[]', + 'allowed_users' => 'string[]', + 'denied_users' => 'string[]', + 'allow_guests' => 'bool', + 'home_tab_content' => 'string', + 'agent_access_control' => 'object', + 'keywords_enabled' => 'bool', + 'keywords' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'status' => null, + 'system_prompt' => null, + 'model_id' => null, + 'temperature' => null, + 'max_tokens' => null, + 'allowed_tools' => null, + 'assigned_skills' => null, + 'allowed_collections' => null, + 'allowed_sub_agents' => null, + 'guardrail_preset' => null, + 'filter_policies' => null, + 'long_context' => null, + 'session_ttl_days' => null, + 'allowed_channels' => null, + 'allowed_users' => null, + 'denied_users' => null, + 'allow_guests' => null, + 'home_tab_content' => null, + 'agent_access_control' => null, + 'keywords_enabled' => null, + 'keywords' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'status' => false, + 'system_prompt' => false, + 'model_id' => false, + 'temperature' => false, + 'max_tokens' => false, + 'allowed_tools' => false, + 'assigned_skills' => false, + 'allowed_collections' => false, + 'allowed_sub_agents' => false, + 'guardrail_preset' => false, + 'filter_policies' => false, + 'long_context' => false, + 'session_ttl_days' => false, + 'allowed_channels' => false, + 'allowed_users' => false, + 'denied_users' => false, + 'allow_guests' => false, + 'home_tab_content' => false, + 'agent_access_control' => false, + 'keywords_enabled' => false, + 'keywords' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'status' => 'status', + 'system_prompt' => 'systemPrompt', + 'model_id' => 'modelId', + 'temperature' => 'temperature', + 'max_tokens' => 'maxTokens', + 'allowed_tools' => 'allowedTools', + 'assigned_skills' => 'assignedSkills', + 'allowed_collections' => 'allowedCollections', + 'allowed_sub_agents' => 'allowedSubAgents', + 'guardrail_preset' => 'guardrailPreset', + 'filter_policies' => 'filterPolicies', + 'long_context' => 'longContext', + 'session_ttl_days' => 'sessionTtlDays', + 'allowed_channels' => 'allowedChannels', + 'allowed_users' => 'allowedUsers', + 'denied_users' => 'deniedUsers', + 'allow_guests' => 'allowGuests', + 'home_tab_content' => 'homeTabContent', + 'agent_access_control' => 'agentAccessControl', + 'keywords_enabled' => 'keywordsEnabled', + 'keywords' => 'keywords' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'status' => 'setStatus', + 'system_prompt' => 'setSystemPrompt', + 'model_id' => 'setModelId', + 'temperature' => 'setTemperature', + 'max_tokens' => 'setMaxTokens', + 'allowed_tools' => 'setAllowedTools', + 'assigned_skills' => 'setAssignedSkills', + 'allowed_collections' => 'setAllowedCollections', + 'allowed_sub_agents' => 'setAllowedSubAgents', + 'guardrail_preset' => 'setGuardrailPreset', + 'filter_policies' => 'setFilterPolicies', + 'long_context' => 'setLongContext', + 'session_ttl_days' => 'setSessionTtlDays', + 'allowed_channels' => 'setAllowedChannels', + 'allowed_users' => 'setAllowedUsers', + 'denied_users' => 'setDeniedUsers', + 'allow_guests' => 'setAllowGuests', + 'home_tab_content' => 'setHomeTabContent', + 'agent_access_control' => 'setAgentAccessControl', + 'keywords_enabled' => 'setKeywordsEnabled', + 'keywords' => 'setKeywords' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'status' => 'getStatus', + 'system_prompt' => 'getSystemPrompt', + 'model_id' => 'getModelId', + 'temperature' => 'getTemperature', + 'max_tokens' => 'getMaxTokens', + 'allowed_tools' => 'getAllowedTools', + 'assigned_skills' => 'getAssignedSkills', + 'allowed_collections' => 'getAllowedCollections', + 'allowed_sub_agents' => 'getAllowedSubAgents', + 'guardrail_preset' => 'getGuardrailPreset', + 'filter_policies' => 'getFilterPolicies', + 'long_context' => 'getLongContext', + 'session_ttl_days' => 'getSessionTtlDays', + 'allowed_channels' => 'getAllowedChannels', + 'allowed_users' => 'getAllowedUsers', + 'denied_users' => 'getDeniedUsers', + 'allow_guests' => 'getAllowGuests', + 'home_tab_content' => 'getHomeTabContent', + 'agent_access_control' => 'getAgentAccessControl', + 'keywords_enabled' => 'getKeywordsEnabled', + 'keywords' => 'getKeywords' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('system_prompt', $data ?? [], null); + $this->setIfExists('model_id', $data ?? [], null); + $this->setIfExists('temperature', $data ?? [], null); + $this->setIfExists('max_tokens', $data ?? [], null); + $this->setIfExists('allowed_tools', $data ?? [], null); + $this->setIfExists('assigned_skills', $data ?? [], null); + $this->setIfExists('allowed_collections', $data ?? [], null); + $this->setIfExists('allowed_sub_agents', $data ?? [], null); + $this->setIfExists('guardrail_preset', $data ?? [], null); + $this->setIfExists('filter_policies', $data ?? [], null); + $this->setIfExists('long_context', $data ?? [], null); + $this->setIfExists('session_ttl_days', $data ?? [], null); + $this->setIfExists('allowed_channels', $data ?? [], null); + $this->setIfExists('allowed_users', $data ?? [], null); + $this->setIfExists('denied_users', $data ?? [], null); + $this->setIfExists('allow_guests', $data ?? [], null); + $this->setIfExists('home_tab_content', $data ?? [], null); + $this->setIfExists('agent_access_control', $data ?? [], null); + $this->setIfExists('keywords_enabled', $data ?? [], null); + $this->setIfExists('keywords', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['temperature']) && ($this->container['temperature'] > 2)) { + $invalidProperties[] = "invalid value for 'temperature', must be smaller than or equal to 2."; + } + + if (!is_null($this->container['temperature']) && ($this->container['temperature'] < 0)) { + $invalidProperties[] = "invalid value for 'temperature', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['max_tokens']) && ($this->container['max_tokens'] < 1)) { + $invalidProperties[] = "invalid value for 'max_tokens', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['session_ttl_days']) && ($this->container['session_ttl_days'] > 90)) { + $invalidProperties[] = "invalid value for 'session_ttl_days', must be smaller than or equal to 90."; + } + + if (!is_null($this->container['session_ttl_days']) && ($this->container['session_ttl_days'] < 1)) { + $invalidProperties[] = "invalid value for 'session_ttl_days', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Display name for the bot + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Enable or disable the bot + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets system_prompt + * + * @return string|null + */ + public function getSystemPrompt() + { + return $this->container['system_prompt']; + } + + /** + * Sets system_prompt + * + * @param string|null $system_prompt System prompt for the backing AI agent + * + * @return self + */ + public function setSystemPrompt($system_prompt) + { + if (is_null($system_prompt)) { + throw new \InvalidArgumentException('non-nullable system_prompt cannot be null'); + } + $this->container['system_prompt'] = $system_prompt; + + return $this; + } + + /** + * Gets model_id + * + * @return string|null + */ + public function getModelId() + { + return $this->container['model_id']; + } + + /** + * Sets model_id + * + * @param string|null $model_id AI model identifier + * + * @return self + */ + public function setModelId($model_id) + { + if (is_null($model_id)) { + throw new \InvalidArgumentException('non-nullable model_id cannot be null'); + } + $this->container['model_id'] = $model_id; + + return $this; + } + + /** + * Gets temperature + * + * @return float|null + */ + public function getTemperature() + { + return $this->container['temperature']; + } + + /** + * Sets temperature + * + * @param float|null $temperature Sampling temperature + * + * @return self + */ + public function setTemperature($temperature) + { + if (is_null($temperature)) { + throw new \InvalidArgumentException('non-nullable temperature cannot be null'); + } + + if (($temperature > 2)) { + throw new \InvalidArgumentException('invalid value for $temperature when calling UpdateSlackBotRequest., must be smaller than or equal to 2.'); + } + if (($temperature < 0)) { + throw new \InvalidArgumentException('invalid value for $temperature when calling UpdateSlackBotRequest., must be bigger than or equal to 0.'); + } + + $this->container['temperature'] = $temperature; + + return $this; + } + + /** + * Gets max_tokens + * + * @return int|null + */ + public function getMaxTokens() + { + return $this->container['max_tokens']; + } + + /** + * Sets max_tokens + * + * @param int|null $max_tokens Maximum response tokens + * + * @return self + */ + public function setMaxTokens($max_tokens) + { + if (is_null($max_tokens)) { + throw new \InvalidArgumentException('non-nullable max_tokens cannot be null'); + } + + if (($max_tokens < 1)) { + throw new \InvalidArgumentException('invalid value for $max_tokens when calling UpdateSlackBotRequest., must be bigger than or equal to 1.'); + } + + $this->container['max_tokens'] = $max_tokens; + + return $this; + } + + /** + * Gets allowed_tools + * + * @return string[]|null + */ + public function getAllowedTools() + { + return $this->container['allowed_tools']; + } + + /** + * Sets allowed_tools + * + * @param string[]|null $allowed_tools Tools the agent may use + * + * @return self + */ + public function setAllowedTools($allowed_tools) + { + if (is_null($allowed_tools)) { + throw new \InvalidArgumentException('non-nullable allowed_tools cannot be null'); + } + $this->container['allowed_tools'] = $allowed_tools; + + return $this; + } + + /** + * Gets assigned_skills + * + * @return string[]|null + */ + public function getAssignedSkills() + { + return $this->container['assigned_skills']; + } + + /** + * Sets assigned_skills + * + * @param string[]|null $assigned_skills Skills assigned to the agent + * + * @return self + */ + public function setAssignedSkills($assigned_skills) + { + if (is_null($assigned_skills)) { + throw new \InvalidArgumentException('non-nullable assigned_skills cannot be null'); + } + $this->container['assigned_skills'] = $assigned_skills; + + return $this; + } + + /** + * Gets allowed_collections + * + * @return string[]|null + */ + public function getAllowedCollections() + { + return $this->container['allowed_collections']; + } + + /** + * Sets allowed_collections + * + * @param string[]|null $allowed_collections Vector DB collections the agent may query + * + * @return self + */ + public function setAllowedCollections($allowed_collections) + { + if (is_null($allowed_collections)) { + throw new \InvalidArgumentException('non-nullable allowed_collections cannot be null'); + } + $this->container['allowed_collections'] = $allowed_collections; + + return $this; + } + + /** + * Gets allowed_sub_agents + * + * @return string[]|null + */ + public function getAllowedSubAgents() + { + return $this->container['allowed_sub_agents']; + } + + /** + * Sets allowed_sub_agents + * + * @param string[]|null $allowed_sub_agents Sub-agents the agent may call + * + * @return self + */ + public function setAllowedSubAgents($allowed_sub_agents) + { + if (is_null($allowed_sub_agents)) { + throw new \InvalidArgumentException('non-nullable allowed_sub_agents cannot be null'); + } + $this->container['allowed_sub_agents'] = $allowed_sub_agents; + + return $this; + } + + /** + * Gets guardrail_preset + * + * @return string|null + */ + public function getGuardrailPreset() + { + return $this->container['guardrail_preset']; + } + + /** + * Sets guardrail_preset + * + * @param string|null $guardrail_preset Guardrail preset name + * + * @return self + */ + public function setGuardrailPreset($guardrail_preset) + { + if (is_null($guardrail_preset)) { + throw new \InvalidArgumentException('non-nullable guardrail_preset cannot be null'); + } + $this->container['guardrail_preset'] = $guardrail_preset; + + return $this; + } + + /** + * Gets filter_policies + * + * @return string[]|null + */ + public function getFilterPolicies() + { + return $this->container['filter_policies']; + } + + /** + * Sets filter_policies + * + * @param string[]|null $filter_policies Content filter policies + * + * @return self + */ + public function setFilterPolicies($filter_policies) + { + if (is_null($filter_policies)) { + throw new \InvalidArgumentException('non-nullable filter_policies cannot be null'); + } + $this->container['filter_policies'] = $filter_policies; + + return $this; + } + + /** + * Gets long_context + * + * @return bool|null + */ + public function getLongContext() + { + return $this->container['long_context']; + } + + /** + * Sets long_context + * + * @param bool|null $long_context Enable long context mode + * + * @return self + */ + public function setLongContext($long_context) + { + if (is_null($long_context)) { + throw new \InvalidArgumentException('non-nullable long_context cannot be null'); + } + $this->container['long_context'] = $long_context; + + return $this; + } + + /** + * Gets session_ttl_days + * + * @return int|null + */ + public function getSessionTtlDays() + { + return $this->container['session_ttl_days']; + } + + /** + * Sets session_ttl_days + * + * @param int|null $session_ttl_days Session TTL in days + * + * @return self + */ + public function setSessionTtlDays($session_ttl_days) + { + if (is_null($session_ttl_days)) { + throw new \InvalidArgumentException('non-nullable session_ttl_days cannot be null'); + } + + if (($session_ttl_days > 90)) { + throw new \InvalidArgumentException('invalid value for $session_ttl_days when calling UpdateSlackBotRequest., must be smaller than or equal to 90.'); + } + if (($session_ttl_days < 1)) { + throw new \InvalidArgumentException('invalid value for $session_ttl_days when calling UpdateSlackBotRequest., must be bigger than or equal to 1.'); + } + + $this->container['session_ttl_days'] = $session_ttl_days; + + return $this; + } + + /** + * Gets allowed_channels + * + * @return string[]|null + */ + public function getAllowedChannels() + { + return $this->container['allowed_channels']; + } + + /** + * Sets allowed_channels + * + * @param string[]|null $allowed_channels Slack channel IDs the bot may respond in + * + * @return self + */ + public function setAllowedChannels($allowed_channels) + { + if (is_null($allowed_channels)) { + throw new \InvalidArgumentException('non-nullable allowed_channels cannot be null'); + } + $this->container['allowed_channels'] = $allowed_channels; + + return $this; + } + + /** + * Gets allowed_users + * + * @return string[]|null + */ + public function getAllowedUsers() + { + return $this->container['allowed_users']; + } + + /** + * Sets allowed_users + * + * @param string[]|null $allowed_users Slack user IDs allowed to interact with the bot + * + * @return self + */ + public function setAllowedUsers($allowed_users) + { + if (is_null($allowed_users)) { + throw new \InvalidArgumentException('non-nullable allowed_users cannot be null'); + } + $this->container['allowed_users'] = $allowed_users; + + return $this; + } + + /** + * Gets denied_users + * + * @return string[]|null + */ + public function getDeniedUsers() + { + return $this->container['denied_users']; + } + + /** + * Sets denied_users + * + * @param string[]|null $denied_users Slack user IDs denied from interacting with the bot + * + * @return self + */ + public function setDeniedUsers($denied_users) + { + if (is_null($denied_users)) { + throw new \InvalidArgumentException('non-nullable denied_users cannot be null'); + } + $this->container['denied_users'] = $denied_users; + + return $this; + } + + /** + * Gets allow_guests + * + * @return bool|null + */ + public function getAllowGuests() + { + return $this->container['allow_guests']; + } + + /** + * Sets allow_guests + * + * @param bool|null $allow_guests Whether guest users may interact with the bot + * + * @return self + */ + public function setAllowGuests($allow_guests) + { + if (is_null($allow_guests)) { + throw new \InvalidArgumentException('non-nullable allow_guests cannot be null'); + } + $this->container['allow_guests'] = $allow_guests; + + return $this; + } + + /** + * Gets home_tab_content + * + * @return string|null + */ + public function getHomeTabContent() + { + return $this->container['home_tab_content']; + } + + /** + * Sets home_tab_content + * + * @param string|null $home_tab_content Content shown on the bot's Home tab in Slack + * + * @return self + */ + public function setHomeTabContent($home_tab_content) + { + if (is_null($home_tab_content)) { + throw new \InvalidArgumentException('non-nullable home_tab_content cannot be null'); + } + $this->container['home_tab_content'] = $home_tab_content; + + return $this; + } + + /** + * Gets agent_access_control + * + * @return object|null + */ + public function getAgentAccessControl() + { + return $this->container['agent_access_control']; + } + + /** + * Sets agent_access_control + * + * @param object|null $agent_access_control Agent-level access control settings + * + * @return self + */ + public function setAgentAccessControl($agent_access_control) + { + if (is_null($agent_access_control)) { + throw new \InvalidArgumentException('non-nullable agent_access_control cannot be null'); + } + $this->container['agent_access_control'] = $agent_access_control; + + return $this; + } + + /** + * Gets keywords_enabled + * + * @return bool|null + */ + public function getKeywordsEnabled() + { + return $this->container['keywords_enabled']; + } + + /** + * Sets keywords_enabled + * + * @param bool|null $keywords_enabled Whether keyword triggers are enabled + * + * @return self + */ + public function setKeywordsEnabled($keywords_enabled) + { + if (is_null($keywords_enabled)) { + throw new \InvalidArgumentException('non-nullable keywords_enabled cannot be null'); + } + $this->container['keywords_enabled'] = $keywords_enabled; + + return $this; + } + + /** + * Gets keywords + * + * @return string[]|null + */ + public function getKeywords() + { + return $this->container['keywords']; + } + + /** + * Sets keywords + * + * @param string[]|null $keywords Keywords that trigger the bot + * + * @return self + */ + public function setKeywords($keywords) + { + if (is_null($keywords)) { + throw new \InvalidArgumentException('non-nullable keywords cannot be null'); + } + $this->container['keywords'] = $keywords; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UpdateTask200Response.php b/src/Model/UpdateTask200Response.php index 6ae10cef..d8d1a925 100644 --- a/src/Model/UpdateTask200Response.php +++ b/src/Model/UpdateTask200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/UpdateTaskRequest.php b/src/Model/UpdateTaskRequest.php index 55d55bd4..4fbf4b23 100644 --- a/src/Model/UpdateTaskRequest.php +++ b/src/Model/UpdateTaskRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/UploadFile201Response.php b/src/Model/UploadFile201Response.php index 0a25d335..49beb1e6 100644 --- a/src/Model/UploadFile201Response.php +++ b/src/Model/UploadFile201Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/UploadFileRequest.php b/src/Model/UploadFileRequest.php index b28e5fb3..3bec2615 100644 --- a/src/Model/UploadFileRequest.php +++ b/src/Model/UploadFileRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/UploadVectorDocuments200Response.php b/src/Model/UploadVectorDocuments200Response.php index c085ffe8..9749e4e7 100644 --- a/src/Model/UploadVectorDocuments200Response.php +++ b/src/Model/UploadVectorDocuments200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/UploadVectorDocumentsRequest.php b/src/Model/UploadVectorDocumentsRequest.php index d2815a33..b46caf04 100644 --- a/src/Model/UploadVectorDocumentsRequest.php +++ b/src/Model/UploadVectorDocumentsRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/UploadVectorDocumentsRequestDocumentsInner.php b/src/Model/UploadVectorDocumentsRequestDocumentsInner.php index 1ecbedac..2c25f688 100644 --- a/src/Model/UploadVectorDocumentsRequestDocumentsInner.php +++ b/src/Model/UploadVectorDocumentsRequestDocumentsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -58,6 +58,7 @@ class UploadVectorDocumentsRequestDocumentsInner implements ModelInterface, Arra */ protected static $openAPITypes = [ 'content' => 'string', + 'key' => 'string', 'metadata' => '\QuantClient\Model\UploadVectorDocumentsRequestDocumentsInnerMetadata' ]; @@ -70,6 +71,7 @@ class UploadVectorDocumentsRequestDocumentsInner implements ModelInterface, Arra */ protected static $openAPIFormats = [ 'content' => null, + 'key' => null, 'metadata' => null ]; @@ -80,6 +82,7 @@ class UploadVectorDocumentsRequestDocumentsInner implements ModelInterface, Arra */ protected static array $openAPINullables = [ 'content' => false, + 'key' => false, 'metadata' => false ]; @@ -170,6 +173,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'content' => 'content', + 'key' => 'key', 'metadata' => 'metadata' ]; @@ -180,6 +184,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'content' => 'setContent', + 'key' => 'setKey', 'metadata' => 'setMetadata' ]; @@ -190,6 +195,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'content' => 'getContent', + 'key' => 'getKey', 'metadata' => 'getMetadata' ]; @@ -251,6 +257,7 @@ public function getModelName() public function __construct(?array $data = null) { $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); $this->setIfExists('metadata', $data ?? [], null); } @@ -284,6 +291,10 @@ public function listInvalidProperties() if ($this->container['content'] === null) { $invalidProperties[] = "'content' can't be null"; } + if (!is_null($this->container['key']) && (mb_strlen($this->container['key']) > 512)) { + $invalidProperties[] = "invalid value for 'key', the character length must be smaller than or equal to 512."; + } + return $invalidProperties; } @@ -326,6 +337,37 @@ public function setContent($content) return $this; } + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Stable document key for upsert + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + if ((mb_strlen($key) > 512)) { + throw new \InvalidArgumentException('invalid length for $key when calling UploadVectorDocumentsRequestDocumentsInner., must be smaller than or equal to 512.'); + } + + $this->container['key'] = $key; + + return $this; + } + /** * Gets metadata * diff --git a/src/Model/UploadVectorDocumentsRequestDocumentsInnerMetadata.php b/src/Model/UploadVectorDocumentsRequestDocumentsInnerMetadata.php index 1f67a437..29e50fb0 100644 --- a/src/Model/UploadVectorDocumentsRequestDocumentsInnerMetadata.php +++ b/src/Model/UploadVectorDocumentsRequestDocumentsInnerMetadata.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/UpsertAgentOverlay200Response.php b/src/Model/UpsertAgentOverlay200Response.php new file mode 100644 index 00000000..5c20367b --- /dev/null +++ b/src/Model/UpsertAgentOverlay200Response.php @@ -0,0 +1,409 @@ + + */ +class UpsertAgentOverlay200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'upsertAgentOverlay_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'overlay' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'overlay' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'overlay' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'overlay' => 'overlay' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'overlay' => 'setOverlay' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'overlay' => 'getOverlay' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('overlay', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets overlay + * + * @return object|null + */ + public function getOverlay() + { + return $this->container['overlay']; + } + + /** + * Sets overlay + * + * @param object|null $overlay overlay + * + * @return self + */ + public function setOverlay($overlay) + { + if (is_null($overlay)) { + throw new \InvalidArgumentException('non-nullable overlay cannot be null'); + } + $this->container['overlay'] = $overlay; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/UpsertAgentOverlayRequest.php b/src/Model/UpsertAgentOverlayRequest.php new file mode 100644 index 00000000..dcee26b6 --- /dev/null +++ b/src/Model/UpsertAgentOverlayRequest.php @@ -0,0 +1,817 @@ + + */ +class UpsertAgentOverlayRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'upsertAgentOverlay_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'model_id' => 'string', + 'temperature' => 'float', + 'max_tokens' => 'int', + 'disabled_skills' => 'string[]', + 'additional_skills' => 'string[]', + 'additional_tools' => 'string[]', + 'disabled_tools' => 'string[]', + 'system_prompt_append' => 'string', + 'allowed_collections' => 'string[]', + 'guardrail_preset' => 'string', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'model_id' => null, + 'temperature' => null, + 'max_tokens' => null, + 'disabled_skills' => null, + 'additional_skills' => null, + 'additional_tools' => null, + 'disabled_tools' => null, + 'system_prompt_append' => null, + 'allowed_collections' => null, + 'guardrail_preset' => null, + 'version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'model_id' => false, + 'temperature' => false, + 'max_tokens' => false, + 'disabled_skills' => false, + 'additional_skills' => false, + 'additional_tools' => false, + 'disabled_tools' => false, + 'system_prompt_append' => false, + 'allowed_collections' => false, + 'guardrail_preset' => true, + 'version' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'model_id' => 'modelId', + 'temperature' => 'temperature', + 'max_tokens' => 'maxTokens', + 'disabled_skills' => 'disabledSkills', + 'additional_skills' => 'additionalSkills', + 'additional_tools' => 'additionalTools', + 'disabled_tools' => 'disabledTools', + 'system_prompt_append' => 'systemPromptAppend', + 'allowed_collections' => 'allowedCollections', + 'guardrail_preset' => 'guardrailPreset', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'model_id' => 'setModelId', + 'temperature' => 'setTemperature', + 'max_tokens' => 'setMaxTokens', + 'disabled_skills' => 'setDisabledSkills', + 'additional_skills' => 'setAdditionalSkills', + 'additional_tools' => 'setAdditionalTools', + 'disabled_tools' => 'setDisabledTools', + 'system_prompt_append' => 'setSystemPromptAppend', + 'allowed_collections' => 'setAllowedCollections', + 'guardrail_preset' => 'setGuardrailPreset', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'model_id' => 'getModelId', + 'temperature' => 'getTemperature', + 'max_tokens' => 'getMaxTokens', + 'disabled_skills' => 'getDisabledSkills', + 'additional_skills' => 'getAdditionalSkills', + 'additional_tools' => 'getAdditionalTools', + 'disabled_tools' => 'getDisabledTools', + 'system_prompt_append' => 'getSystemPromptAppend', + 'allowed_collections' => 'getAllowedCollections', + 'guardrail_preset' => 'getGuardrailPreset', + 'version' => 'getVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const GUARDRAIL_PRESET_OFFICIAL = 'official'; + public const GUARDRAIL_PRESET_OFFICIAL_SENSITIVE = 'official-sensitive'; + public const GUARDRAIL_PRESET__PROTECTED = 'protected'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getGuardrailPresetAllowableValues() + { + return [ + self::GUARDRAIL_PRESET_OFFICIAL, + self::GUARDRAIL_PRESET_OFFICIAL_SENSITIVE, + self::GUARDRAIL_PRESET__PROTECTED, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('model_id', $data ?? [], null); + $this->setIfExists('temperature', $data ?? [], null); + $this->setIfExists('max_tokens', $data ?? [], null); + $this->setIfExists('disabled_skills', $data ?? [], null); + $this->setIfExists('additional_skills', $data ?? [], null); + $this->setIfExists('additional_tools', $data ?? [], null); + $this->setIfExists('disabled_tools', $data ?? [], null); + $this->setIfExists('system_prompt_append', $data ?? [], null); + $this->setIfExists('allowed_collections', $data ?? [], null); + $this->setIfExists('guardrail_preset', $data ?? [], null); + $this->setIfExists('version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['temperature']) && ($this->container['temperature'] > 1)) { + $invalidProperties[] = "invalid value for 'temperature', must be smaller than or equal to 1."; + } + + if (!is_null($this->container['temperature']) && ($this->container['temperature'] < 0)) { + $invalidProperties[] = "invalid value for 'temperature', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['max_tokens']) && ($this->container['max_tokens'] < 1)) { + $invalidProperties[] = "invalid value for 'max_tokens', must be bigger than or equal to 1."; + } + + $allowedValues = $this->getGuardrailPresetAllowableValues(); + if (!is_null($this->container['guardrail_preset']) && !in_array($this->container['guardrail_preset'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'guardrail_preset', must be one of '%s'", + $this->container['guardrail_preset'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets model_id + * + * @return string|null + */ + public function getModelId() + { + return $this->container['model_id']; + } + + /** + * Sets model_id + * + * @param string|null $model_id Override the base agent's model + * + * @return self + */ + public function setModelId($model_id) + { + if (is_null($model_id)) { + throw new \InvalidArgumentException('non-nullable model_id cannot be null'); + } + $this->container['model_id'] = $model_id; + + return $this; + } + + /** + * Gets temperature + * + * @return float|null + */ + public function getTemperature() + { + return $this->container['temperature']; + } + + /** + * Sets temperature + * + * @param float|null $temperature Override temperature + * + * @return self + */ + public function setTemperature($temperature) + { + if (is_null($temperature)) { + throw new \InvalidArgumentException('non-nullable temperature cannot be null'); + } + + if (($temperature > 1)) { + throw new \InvalidArgumentException('invalid value for $temperature when calling UpsertAgentOverlayRequest., must be smaller than or equal to 1.'); + } + if (($temperature < 0)) { + throw new \InvalidArgumentException('invalid value for $temperature when calling UpsertAgentOverlayRequest., must be bigger than or equal to 0.'); + } + + $this->container['temperature'] = $temperature; + + return $this; + } + + /** + * Gets max_tokens + * + * @return int|null + */ + public function getMaxTokens() + { + return $this->container['max_tokens']; + } + + /** + * Sets max_tokens + * + * @param int|null $max_tokens Override max tokens + * + * @return self + */ + public function setMaxTokens($max_tokens) + { + if (is_null($max_tokens)) { + throw new \InvalidArgumentException('non-nullable max_tokens cannot be null'); + } + + if (($max_tokens < 1)) { + throw new \InvalidArgumentException('invalid value for $max_tokens when calling UpsertAgentOverlayRequest., must be bigger than or equal to 1.'); + } + + $this->container['max_tokens'] = $max_tokens; + + return $this; + } + + /** + * Gets disabled_skills + * + * @return string[]|null + */ + public function getDisabledSkills() + { + return $this->container['disabled_skills']; + } + + /** + * Sets disabled_skills + * + * @param string[]|null $disabled_skills Global skill IDs to exclude + * + * @return self + */ + public function setDisabledSkills($disabled_skills) + { + if (is_null($disabled_skills)) { + throw new \InvalidArgumentException('non-nullable disabled_skills cannot be null'); + } + $this->container['disabled_skills'] = $disabled_skills; + + return $this; + } + + /** + * Gets additional_skills + * + * @return string[]|null + */ + public function getAdditionalSkills() + { + return $this->container['additional_skills']; + } + + /** + * Sets additional_skills + * + * @param string[]|null $additional_skills Org-owned skill IDs to add + * + * @return self + */ + public function setAdditionalSkills($additional_skills) + { + if (is_null($additional_skills)) { + throw new \InvalidArgumentException('non-nullable additional_skills cannot be null'); + } + $this->container['additional_skills'] = $additional_skills; + + return $this; + } + + /** + * Gets additional_tools + * + * @return string[]|null + */ + public function getAdditionalTools() + { + return $this->container['additional_tools']; + } + + /** + * Sets additional_tools + * + * @param string[]|null $additional_tools Tool names to add + * + * @return self + */ + public function setAdditionalTools($additional_tools) + { + if (is_null($additional_tools)) { + throw new \InvalidArgumentException('non-nullable additional_tools cannot be null'); + } + $this->container['additional_tools'] = $additional_tools; + + return $this; + } + + /** + * Gets disabled_tools + * + * @return string[]|null + */ + public function getDisabledTools() + { + return $this->container['disabled_tools']; + } + + /** + * Sets disabled_tools + * + * @param string[]|null $disabled_tools Tool names to remove + * + * @return self + */ + public function setDisabledTools($disabled_tools) + { + if (is_null($disabled_tools)) { + throw new \InvalidArgumentException('non-nullable disabled_tools cannot be null'); + } + $this->container['disabled_tools'] = $disabled_tools; + + return $this; + } + + /** + * Gets system_prompt_append + * + * @return string|null + */ + public function getSystemPromptAppend() + { + return $this->container['system_prompt_append']; + } + + /** + * Sets system_prompt_append + * + * @param string|null $system_prompt_append Text appended to base system prompt + * + * @return self + */ + public function setSystemPromptAppend($system_prompt_append) + { + if (is_null($system_prompt_append)) { + throw new \InvalidArgumentException('non-nullable system_prompt_append cannot be null'); + } + $this->container['system_prompt_append'] = $system_prompt_append; + + return $this; + } + + /** + * Gets allowed_collections + * + * @return string[]|null + */ + public function getAllowedCollections() + { + return $this->container['allowed_collections']; + } + + /** + * Sets allowed_collections + * + * @param string[]|null $allowed_collections Vector DB collections + * + * @return self + */ + public function setAllowedCollections($allowed_collections) + { + if (is_null($allowed_collections)) { + throw new \InvalidArgumentException('non-nullable allowed_collections cannot be null'); + } + $this->container['allowed_collections'] = $allowed_collections; + + return $this; + } + + /** + * Gets guardrail_preset + * + * @return string|null + */ + public function getGuardrailPreset() + { + return $this->container['guardrail_preset']; + } + + /** + * Sets guardrail_preset + * + * @param string|null $guardrail_preset Guardrail preset + * + * @return self + */ + public function setGuardrailPreset($guardrail_preset) + { + if (is_null($guardrail_preset)) { + array_push($this->openAPINullablesSetToNull, 'guardrail_preset'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('guardrail_preset', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $allowedValues = $this->getGuardrailPresetAllowableValues(); + if (!is_null($guardrail_preset) && !in_array($guardrail_preset, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'guardrail_preset', must be one of '%s'", + $guardrail_preset, + implode("', '", $allowedValues) + ) + ); + } + $this->container['guardrail_preset'] = $guardrail_preset; + + return $this; + } + + /** + * Gets version + * + * @return int|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int|null $version Current version for optimistic concurrency + * + * @return self + */ + public function setVersion($version) + { + if (is_null($version)) { + throw new \InvalidArgumentException('non-nullable version cannot be null'); + } + $this->container['version'] = $version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/V1ContentItem.php b/src/Model/V1ContentItem.php index 5b889a77..a131b06b 100644 --- a/src/Model/V1ContentItem.php +++ b/src/Model/V1ContentItem.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1ContentListResponse.php b/src/Model/V1ContentListResponse.php index 5d193765..168ee9f3 100644 --- a/src/Model/V1ContentListResponse.php +++ b/src/Model/V1ContentListResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1ContentRequest.php b/src/Model/V1ContentRequest.php index 71ae074f..14935fee 100644 --- a/src/Model/V1ContentRequest.php +++ b/src/Model/V1ContentRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1DeleteResponse.php b/src/Model/V1DeleteResponse.php index 22af02d9..8720fe80 100644 --- a/src/Model/V1DeleteResponse.php +++ b/src/Model/V1DeleteResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1Error.php b/src/Model/V1Error.php index 8caa5722..ff30f9f3 100644 --- a/src/Model/V1Error.php +++ b/src/Model/V1Error.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1FormSubmissionItem.php b/src/Model/V1FormSubmissionItem.php index ca0646dc..30252cd6 100644 --- a/src/Model/V1FormSubmissionItem.php +++ b/src/Model/V1FormSubmissionItem.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1FormSubmissionListResponse.php b/src/Model/V1FormSubmissionListResponse.php index 9e6d6248..a95619db 100644 --- a/src/Model/V1FormSubmissionListResponse.php +++ b/src/Model/V1FormSubmissionListResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1GetMetricSeriesResponse.php b/src/Model/V1GetMetricSeriesResponse.php index b20e1b11..cb8813c6 100644 --- a/src/Model/V1GetMetricSeriesResponse.php +++ b/src/Model/V1GetMetricSeriesResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1GetMetricSeriesResponseData.php b/src/Model/V1GetMetricSeriesResponseData.php index da378f13..c0e808f2 100644 --- a/src/Model/V1GetMetricSeriesResponseData.php +++ b/src/Model/V1GetMetricSeriesResponseData.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1GetMetricsResponse.php b/src/Model/V1GetMetricsResponse.php index ad447aa2..cdf65933 100644 --- a/src/Model/V1GetMetricsResponse.php +++ b/src/Model/V1GetMetricsResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1GetMetricsResponseData.php b/src/Model/V1GetMetricsResponseData.php index 78939b77..fa5dfec1 100644 --- a/src/Model/V1GetMetricsResponseData.php +++ b/src/Model/V1GetMetricsResponseData.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1GlobalMetaResponse.php b/src/Model/V1GlobalMetaResponse.php index 8d1da704..329463f5 100644 --- a/src/Model/V1GlobalMetaResponse.php +++ b/src/Model/V1GlobalMetaResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1GlobalMetaResponseGlobalMeta.php b/src/Model/V1GlobalMetaResponseGlobalMeta.php index 6e7d3b60..1c8ff9a4 100644 --- a/src/Model/V1GlobalMetaResponseGlobalMeta.php +++ b/src/Model/V1GlobalMetaResponseGlobalMeta.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1Info.php b/src/Model/V1Info.php index f5f7bc84..cc863af8 100644 --- a/src/Model/V1Info.php +++ b/src/Model/V1Info.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1Meta.php b/src/Model/V1Meta.php index 22241330..716222b9 100644 --- a/src/Model/V1Meta.php +++ b/src/Model/V1Meta.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1MetricDayStats.php b/src/Model/V1MetricDayStats.php index bc0a9186..931f6156 100644 --- a/src/Model/V1MetricDayStats.php +++ b/src/Model/V1MetricDayStats.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1MetricMinuteStats.php b/src/Model/V1MetricMinuteStats.php index 411d1c0c..4b4657f5 100644 --- a/src/Model/V1MetricMinuteStats.php +++ b/src/Model/V1MetricMinuteStats.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1MetricMonthStats.php b/src/Model/V1MetricMonthStats.php index 6742c3ae..099e6d98 100644 --- a/src/Model/V1MetricMonthStats.php +++ b/src/Model/V1MetricMonthStats.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1PingResponse.php b/src/Model/V1PingResponse.php index 670f6585..525af582 100644 --- a/src/Model/V1PingResponse.php +++ b/src/Model/V1PingResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1ProxyItem.php b/src/Model/V1ProxyItem.php index 1c75bca6..dba75d23 100644 --- a/src/Model/V1ProxyItem.php +++ b/src/Model/V1ProxyItem.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1ProxyListResponse.php b/src/Model/V1ProxyListResponse.php index 6895e696..37ff29c1 100644 --- a/src/Model/V1ProxyListResponse.php +++ b/src/Model/V1ProxyListResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1RedirectItem.php b/src/Model/V1RedirectItem.php index aa1ea0ee..441d0cef 100644 --- a/src/Model/V1RedirectItem.php +++ b/src/Model/V1RedirectItem.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1RedirectListResponse.php b/src/Model/V1RedirectListResponse.php index 1da09673..8416c01e 100644 --- a/src/Model/V1RedirectListResponse.php +++ b/src/Model/V1RedirectListResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1RedirectRequest.php b/src/Model/V1RedirectRequest.php index 87997959..7c07f056 100644 --- a/src/Model/V1RedirectRequest.php +++ b/src/Model/V1RedirectRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1RedirectResponse.php b/src/Model/V1RedirectResponse.php index 1dbcf893..85132c4e 100644 --- a/src/Model/V1RedirectResponse.php +++ b/src/Model/V1RedirectResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1Revision.php b/src/Model/V1Revision.php index 35505f22..75a639f2 100644 --- a/src/Model/V1Revision.php +++ b/src/Model/V1Revision.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1RevisionsResponse.php b/src/Model/V1RevisionsResponse.php index b112dc0c..698031c5 100644 --- a/src/Model/V1RevisionsResponse.php +++ b/src/Model/V1RevisionsResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1SearchHit.php b/src/Model/V1SearchHit.php index 66e4a831..f3aed40c 100644 --- a/src/Model/V1SearchHit.php +++ b/src/Model/V1SearchHit.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1SearchItemsResponse.php b/src/Model/V1SearchItemsResponse.php index f294e572..3ed4907e 100644 --- a/src/Model/V1SearchItemsResponse.php +++ b/src/Model/V1SearchItemsResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1SearchMutationResponse.php b/src/Model/V1SearchMutationResponse.php index 69c4df33..d7c7d716 100644 --- a/src/Model/V1SearchMutationResponse.php +++ b/src/Model/V1SearchMutationResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1SearchRecord.php b/src/Model/V1SearchRecord.php index c819623b..28661d3b 100644 --- a/src/Model/V1SearchRecord.php +++ b/src/Model/V1SearchRecord.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1SearchResponse.php b/src/Model/V1SearchResponse.php index f9c04ee2..536c3433 100644 --- a/src/Model/V1SearchResponse.php +++ b/src/Model/V1SearchResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1SeriesPointDay.php b/src/Model/V1SeriesPointDay.php index 1157378b..db5fe107 100644 --- a/src/Model/V1SeriesPointDay.php +++ b/src/Model/V1SeriesPointDay.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1SeriesPointMonth.php b/src/Model/V1SeriesPointMonth.php index e3fd6994..3cd8b05f 100644 --- a/src/Model/V1SeriesPointMonth.php +++ b/src/Model/V1SeriesPointMonth.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1Transition.php b/src/Model/V1Transition.php index a0941be6..791cb375 100644 --- a/src/Model/V1Transition.php +++ b/src/Model/V1Transition.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1UploadResponse.php b/src/Model/V1UploadResponse.php index 61260747..16c3a97d 100644 --- a/src/Model/V1UploadResponse.php +++ b/src/Model/V1UploadResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1UrlMetaRequest.php b/src/Model/V1UrlMetaRequest.php index 1b9afbe0..d3c30f8a 100644 --- a/src/Model/V1UrlMetaRequest.php +++ b/src/Model/V1UrlMetaRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1UrlMetaResponse.php b/src/Model/V1UrlMetaResponse.php index a2c3929d..bde4ac8c 100644 --- a/src/Model/V1UrlMetaResponse.php +++ b/src/Model/V1UrlMetaResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1WafLogItem.php b/src/Model/V1WafLogItem.php index bb824718..47176809 100644 --- a/src/Model/V1WafLogItem.php +++ b/src/Model/V1WafLogItem.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V1WafLogListResponse.php b/src/Model/V1WafLogListResponse.php index b66242ec..55a67c1f 100644 --- a/src/Model/V1WafLogListResponse.php +++ b/src/Model/V1WafLogListResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2Crawler.php b/src/Model/V2Crawler.php index 91ed6fe1..241561e5 100644 --- a/src/Model/V2Crawler.php +++ b/src/Model/V2Crawler.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2CrawlerAssets.php b/src/Model/V2CrawlerAssets.php index 9305d895..a9ccf2b5 100644 --- a/src/Model/V2CrawlerAssets.php +++ b/src/Model/V2CrawlerAssets.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2CrawlerAssetsNetworkIntercept.php b/src/Model/V2CrawlerAssetsNetworkIntercept.php index d09a8b4c..c854dd5e 100644 --- a/src/Model/V2CrawlerAssetsNetworkIntercept.php +++ b/src/Model/V2CrawlerAssetsNetworkIntercept.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2CrawlerAssetsParser.php b/src/Model/V2CrawlerAssetsParser.php index f575638d..15f8c396 100644 --- a/src/Model/V2CrawlerAssetsParser.php +++ b/src/Model/V2CrawlerAssetsParser.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2CrawlerRequest.php b/src/Model/V2CrawlerRequest.php index 159533a5..8e5fd623 100644 --- a/src/Model/V2CrawlerRequest.php +++ b/src/Model/V2CrawlerRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2CrawlerRun.php b/src/Model/V2CrawlerRun.php index db57deed..7a0f90dd 100644 --- a/src/Model/V2CrawlerRun.php +++ b/src/Model/V2CrawlerRun.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2CrawlerSchedule.php b/src/Model/V2CrawlerSchedule.php index ea846190..06712ef8 100644 --- a/src/Model/V2CrawlerSchedule.php +++ b/src/Model/V2CrawlerSchedule.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -535,7 +535,7 @@ public function getScheduleCronString() /** * Sets schedule_cron_string * - * @param string $schedule_cron_string Cron schedule string + * @param string $schedule_cron_string Standard Unix cron expression with 5 space-separated fields: minute, hour, day-of-month, month, day-of-week. Example: 0 2 * * * runs daily at 2 AM. * * @return self */ diff --git a/src/Model/V2CrawlerScheduleRequest.php b/src/Model/V2CrawlerScheduleRequest.php index 75b59c9a..63a48cea 100644 --- a/src/Model/V2CrawlerScheduleRequest.php +++ b/src/Model/V2CrawlerScheduleRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -281,9 +281,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } if ($this->container['schedule_cron_string'] === null) { $invalidProperties[] = "'schedule_cron_string' can't be null"; } @@ -305,7 +302,7 @@ public function valid() /** * Gets name * - * @return string + * @return string|null */ public function getName() { @@ -315,7 +312,7 @@ public function getName() /** * Sets name * - * @param string $name Schedule name + * @param string|null $name Schedule name. If not provided, defaults to 'Schedule {crawler_name}'. * * @return self */ @@ -342,7 +339,7 @@ public function getScheduleCronString() /** * Sets schedule_cron_string * - * @param string $schedule_cron_string Cron schedule string + * @param string $schedule_cron_string Standard Unix cron expression with 5 space-separated fields: minute, hour, day-of-month, month, day-of-week. Example: 0 2 * * * for daily at 2 AM. * * @return self */ diff --git a/src/Model/V2CrawlerSitemapInner.php b/src/Model/V2CrawlerSitemapInner.php index bbf12204..aa989ba8 100644 --- a/src/Model/V2CrawlerSitemapInner.php +++ b/src/Model/V2CrawlerSitemapInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2CustomHeaderRequest.php b/src/Model/V2CustomHeaderRequest.php index 335488f4..25ebc3a1 100644 --- a/src/Model/V2CustomHeaderRequest.php +++ b/src/Model/V2CustomHeaderRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2Domain.php b/src/Model/V2Domain.php index 3a0deec6..ea0ab38e 100644 --- a/src/Model/V2Domain.php +++ b/src/Model/V2Domain.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2DomainDnsGoLiveRecordsInner.php b/src/Model/V2DomainDnsGoLiveRecordsInner.php index 35c5364e..d2d31d1a 100644 --- a/src/Model/V2DomainDnsGoLiveRecordsInner.php +++ b/src/Model/V2DomainDnsGoLiveRecordsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2DomainDnsValidationRecordsInner.php b/src/Model/V2DomainDnsValidationRecordsInner.php index fad806f9..8320f775 100644 --- a/src/Model/V2DomainDnsValidationRecordsInner.php +++ b/src/Model/V2DomainDnsValidationRecordsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2DomainRequest.php b/src/Model/V2DomainRequest.php index 060e6925..0425d6b5 100644 --- a/src/Model/V2DomainRequest.php +++ b/src/Model/V2DomainRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2Error.php b/src/Model/V2Error.php index 32f4c84b..57638f3d 100644 --- a/src/Model/V2Error.php +++ b/src/Model/V2Error.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2MetricData.php b/src/Model/V2MetricData.php new file mode 100644 index 00000000..b41fc377 --- /dev/null +++ b/src/Model/V2MetricData.php @@ -0,0 +1,523 @@ + + */ +class V2MetricData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'V2MetricData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'series' => '\QuantClient\Model\V2MetricDataPoint[]', + 'period_total' => 'float', + 'all_time_total' => 'float', + 'period_average' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'series' => null, + 'period_total' => null, + 'all_time_total' => null, + 'period_average' => 'float' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'series' => false, + 'period_total' => false, + 'all_time_total' => false, + 'period_average' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'series' => 'series', + 'period_total' => 'period_total', + 'all_time_total' => 'all_time_total', + 'period_average' => 'period_average' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'series' => 'setSeries', + 'period_total' => 'setPeriodTotal', + 'all_time_total' => 'setAllTimeTotal', + 'period_average' => 'setPeriodAverage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'series' => 'getSeries', + 'period_total' => 'getPeriodTotal', + 'all_time_total' => 'getAllTimeTotal', + 'period_average' => 'getPeriodAverage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('series', $data ?? [], null); + $this->setIfExists('period_total', $data ?? [], null); + $this->setIfExists('all_time_total', $data ?? [], null); + $this->setIfExists('period_average', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['series'] === null) { + $invalidProperties[] = "'series' can't be null"; + } + if ($this->container['period_total'] === null) { + $invalidProperties[] = "'period_total' can't be null"; + } + if ($this->container['all_time_total'] === null) { + $invalidProperties[] = "'all_time_total' can't be null"; + } + if ($this->container['period_average'] === null) { + $invalidProperties[] = "'period_average' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets series + * + * @return \QuantClient\Model\V2MetricDataPoint[] + */ + public function getSeries() + { + return $this->container['series']; + } + + /** + * Sets series + * + * @param \QuantClient\Model\V2MetricDataPoint[] $series Time series data points + * + * @return self + */ + public function setSeries($series) + { + if (is_null($series)) { + throw new \InvalidArgumentException('non-nullable series cannot be null'); + } + $this->container['series'] = $series; + + return $this; + } + + /** + * Gets period_total + * + * @return float + */ + public function getPeriodTotal() + { + return $this->container['period_total']; + } + + /** + * Sets period_total + * + * @param float $period_total Total value for the period + * + * @return self + */ + public function setPeriodTotal($period_total) + { + if (is_null($period_total)) { + throw new \InvalidArgumentException('non-nullable period_total cannot be null'); + } + $this->container['period_total'] = $period_total; + + return $this; + } + + /** + * Gets all_time_total + * + * @return float + */ + public function getAllTimeTotal() + { + return $this->container['all_time_total']; + } + + /** + * Sets all_time_total + * + * @param float $all_time_total All-time total value + * + * @return self + */ + public function setAllTimeTotal($all_time_total) + { + if (is_null($all_time_total)) { + throw new \InvalidArgumentException('non-nullable all_time_total cannot be null'); + } + $this->container['all_time_total'] = $all_time_total; + + return $this; + } + + /** + * Gets period_average + * + * @return float + */ + public function getPeriodAverage() + { + return $this->container['period_average']; + } + + /** + * Sets period_average + * + * @param float $period_average Average value per time unit in the period + * + * @return self + */ + public function setPeriodAverage($period_average) + { + if (is_null($period_average)) { + throw new \InvalidArgumentException('non-nullable period_average cannot be null'); + } + $this->container['period_average'] = $period_average; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/V2MetricDataPoint.php b/src/Model/V2MetricDataPoint.php new file mode 100644 index 00000000..97212aaf --- /dev/null +++ b/src/Model/V2MetricDataPoint.php @@ -0,0 +1,449 @@ + + */ +class V2MetricDataPoint implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'V2MetricDataPoint'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'timestamp' => '\QuantClient\Model\V2MetricDataPointTimestamp', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'timestamp' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'timestamp' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'timestamp' => 'timestamp', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'timestamp' => 'setTimestamp', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'timestamp' => 'getTimestamp', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets timestamp + * + * @return \QuantClient\Model\V2MetricDataPointTimestamp + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \QuantClient\Model\V2MetricDataPointTimestamp $timestamp timestamp + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets value + * + * @return float + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float $value Metric value at this timestamp + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/V2MetricDataPointTimestamp.php b/src/Model/V2MetricDataPointTimestamp.php new file mode 100644 index 00000000..1e84ea2f --- /dev/null +++ b/src/Model/V2MetricDataPointTimestamp.php @@ -0,0 +1,382 @@ + + */ +class V2MetricDataPointTimestamp implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'V2MetricDataPoint_timestamp'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/V2MetricsMeta.php b/src/Model/V2MetricsMeta.php new file mode 100644 index 00000000..6eabeabc --- /dev/null +++ b/src/Model/V2MetricsMeta.php @@ -0,0 +1,673 @@ + + */ +class V2MetricsMeta implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'V2MetricsMeta'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'period' => 'string', + 'granularity' => 'string', + 'start_time' => 'string', + 'end_time' => 'string', + 'metrics' => 'string[]', + 'domain' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'period' => null, + 'granularity' => null, + 'start_time' => null, + 'end_time' => null, + 'metrics' => null, + 'domain' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'period' => false, + 'granularity' => false, + 'start_time' => false, + 'end_time' => false, + 'metrics' => false, + 'domain' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'period' => 'period', + 'granularity' => 'granularity', + 'start_time' => 'start_time', + 'end_time' => 'end_time', + 'metrics' => 'metrics', + 'domain' => 'domain' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'period' => 'setPeriod', + 'granularity' => 'setGranularity', + 'start_time' => 'setStartTime', + 'end_time' => 'setEndTime', + 'metrics' => 'setMetrics', + 'domain' => 'setDomain' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'period' => 'getPeriod', + 'granularity' => 'getGranularity', + 'start_time' => 'getStartTime', + 'end_time' => 'getEndTime', + 'metrics' => 'getMetrics', + 'domain' => 'getDomain' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const PERIOD_HOURLY = 'hourly'; + public const PERIOD_DAILY = 'daily'; + public const PERIOD_MONTHLY = 'monthly'; + public const GRANULARITY_MINUTE = 'minute'; + public const GRANULARITY_DAY = 'day'; + public const GRANULARITY_MONTH = 'month'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPeriodAllowableValues() + { + return [ + self::PERIOD_HOURLY, + self::PERIOD_DAILY, + self::PERIOD_MONTHLY, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getGranularityAllowableValues() + { + return [ + self::GRANULARITY_MINUTE, + self::GRANULARITY_DAY, + self::GRANULARITY_MONTH, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('period', $data ?? [], null); + $this->setIfExists('granularity', $data ?? [], null); + $this->setIfExists('start_time', $data ?? [], null); + $this->setIfExists('end_time', $data ?? [], null); + $this->setIfExists('metrics', $data ?? [], null); + $this->setIfExists('domain', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['period'] === null) { + $invalidProperties[] = "'period' can't be null"; + } + $allowedValues = $this->getPeriodAllowableValues(); + if (!is_null($this->container['period']) && !in_array($this->container['period'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'period', must be one of '%s'", + $this->container['period'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['granularity'] === null) { + $invalidProperties[] = "'granularity' can't be null"; + } + $allowedValues = $this->getGranularityAllowableValues(); + if (!is_null($this->container['granularity']) && !in_array($this->container['granularity'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'granularity', must be one of '%s'", + $this->container['granularity'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['start_time'] === null) { + $invalidProperties[] = "'start_time' can't be null"; + } + if ($this->container['end_time'] === null) { + $invalidProperties[] = "'end_time' can't be null"; + } + if ($this->container['metrics'] === null) { + $invalidProperties[] = "'metrics' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets period + * + * @return string + */ + public function getPeriod() + { + return $this->container['period']; + } + + /** + * Sets period + * + * @param string $period The period type for this data + * + * @return self + */ + public function setPeriod($period) + { + if (is_null($period)) { + throw new \InvalidArgumentException('non-nullable period cannot be null'); + } + $allowedValues = $this->getPeriodAllowableValues(); + if (!in_array($period, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'period', must be one of '%s'", + $period, + implode("', '", $allowedValues) + ) + ); + } + $this->container['period'] = $period; + + return $this; + } + + /** + * Gets granularity + * + * @return string + */ + public function getGranularity() + { + return $this->container['granularity']; + } + + /** + * Sets granularity + * + * @param string $granularity The granularity of data points + * + * @return self + */ + public function setGranularity($granularity) + { + if (is_null($granularity)) { + throw new \InvalidArgumentException('non-nullable granularity cannot be null'); + } + $allowedValues = $this->getGranularityAllowableValues(); + if (!in_array($granularity, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'granularity', must be one of '%s'", + $granularity, + implode("', '", $allowedValues) + ) + ); + } + $this->container['granularity'] = $granularity; + + return $this; + } + + /** + * Gets start_time + * + * @return string + */ + public function getStartTime() + { + return $this->container['start_time']; + } + + /** + * Sets start_time + * + * @param string $start_time Start time of the data range (ISO8601 or Unix timestamp based on timestamp_format parameter) + * + * @return self + */ + public function setStartTime($start_time) + { + if (is_null($start_time)) { + throw new \InvalidArgumentException('non-nullable start_time cannot be null'); + } + $this->container['start_time'] = $start_time; + + return $this; + } + + /** + * Gets end_time + * + * @return string + */ + public function getEndTime() + { + return $this->container['end_time']; + } + + /** + * Sets end_time + * + * @param string $end_time End time of the data range (ISO8601 or Unix timestamp based on timestamp_format parameter) + * + * @return self + */ + public function setEndTime($end_time) + { + if (is_null($end_time)) { + throw new \InvalidArgumentException('non-nullable end_time cannot be null'); + } + $this->container['end_time'] = $end_time; + + return $this; + } + + /** + * Gets metrics + * + * @return string[] + */ + public function getMetrics() + { + return $this->container['metrics']; + } + + /** + * Sets metrics + * + * @param string[] $metrics List of metrics included in the response + * + * @return self + */ + public function setMetrics($metrics) + { + if (is_null($metrics)) { + throw new \InvalidArgumentException('non-nullable metrics cannot be null'); + } + $this->container['metrics'] = $metrics; + + return $this; + } + + /** + * Gets domain + * + * @return string|null + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string|null $domain Domain filter applied (if any) + * + * @return self + */ + public function setDomain($domain) + { + if (is_null($domain)) { + array_push($this->openAPINullablesSetToNull, 'domain'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('domain', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['domain'] = $domain; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/V2MetricsResponse.php b/src/Model/V2MetricsResponse.php new file mode 100644 index 00000000..0c47e72b --- /dev/null +++ b/src/Model/V2MetricsResponse.php @@ -0,0 +1,449 @@ + + */ +class V2MetricsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'V2MetricsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'meta' => '\QuantClient\Model\V2MetricsMeta', + 'data' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'meta' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'meta' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'meta' => 'meta', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'meta' => 'setMeta', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'meta' => 'getMeta', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('meta', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['meta'] === null) { + $invalidProperties[] = "'meta' can't be null"; + } + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets meta + * + * @return \QuantClient\Model\V2MetricsMeta + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param \QuantClient\Model\V2MetricsMeta $meta meta + * + * @return self + */ + public function setMeta($meta) + { + if (is_null($meta)) { + throw new \InvalidArgumentException('non-nullable meta cannot be null'); + } + $this->container['meta'] = $meta; + + return $this; + } + + /** + * Gets data + * + * @return array + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param array $data Metrics data keyed by metric name + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/src/Model/V2Organization.php b/src/Model/V2Organization.php index 00715068..495a4bcf 100644 --- a/src/Model/V2Organization.php +++ b/src/Model/V2Organization.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2OrganizationRequest.php b/src/Model/V2OrganizationRequest.php index 65e3539b..7eee4e9f 100644 --- a/src/Model/V2OrganizationRequest.php +++ b/src/Model/V2OrganizationRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2Project.php b/src/Model/V2Project.php index 6cec9b78..05f33304 100644 --- a/src/Model/V2Project.php +++ b/src/Model/V2Project.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2ProjectRequest.php b/src/Model/V2ProjectRequest.php index 9d9711ae..55ea9356 100644 --- a/src/Model/V2ProjectRequest.php +++ b/src/Model/V2ProjectRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2Rule.php b/src/Model/V2Rule.php index 347159a3..a2e76644 100644 --- a/src/Model/V2Rule.php +++ b/src/Model/V2Rule.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -71,6 +71,9 @@ class V2Rule implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'country' => 'string', 'country_is' => 'string[]', 'country_is_not' => 'string[]', @@ -99,6 +102,9 @@ class V2Rule implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'country' => null, 'country_is' => null, 'country_is_not' => null, @@ -125,6 +131,9 @@ class V2Rule implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'country' => false, 'country_is' => false, 'country_is_not' => false, @@ -231,6 +240,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'country' => 'country', 'country_is' => 'country_is', 'country_is_not' => 'country_is_not', @@ -257,6 +269,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'country' => 'setCountry', 'country_is' => 'setCountryIs', 'country_is_not' => 'setCountryIsNot', @@ -283,6 +298,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'country' => 'getCountry', 'country_is' => 'getCountryIs', 'country_is_not' => 'getCountryIsNot', @@ -360,6 +378,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('country', $data ?? [], null); $this->setIfExists('country_is', $data ?? [], null); $this->setIfExists('country_is_not', $data ?? [], null); @@ -795,6 +816,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets country * diff --git a/src/Model/V2RuleAuth.php b/src/Model/V2RuleAuth.php index e173a4e8..c5675a25 100644 --- a/src/Model/V2RuleAuth.php +++ b/src/Model/V2RuleAuth.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -71,6 +71,9 @@ class V2RuleAuth implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'country' => 'string', 'country_is' => 'string[]', 'country_is_not' => 'string[]', @@ -100,6 +103,9 @@ class V2RuleAuth implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'country' => null, 'country_is' => null, 'country_is_not' => null, @@ -127,6 +133,9 @@ class V2RuleAuth implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'country' => false, 'country_is' => false, 'country_is_not' => false, @@ -234,6 +243,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'country' => 'country', 'country_is' => 'country_is', 'country_is_not' => 'country_is_not', @@ -261,6 +273,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'country' => 'setCountry', 'country_is' => 'setCountryIs', 'country_is_not' => 'setCountryIsNot', @@ -288,6 +303,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'country' => 'getCountry', 'country_is' => 'getCountryIs', 'country_is_not' => 'getCountryIsNot', @@ -366,6 +384,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('country', $data ?? [], null); $this->setIfExists('country_is', $data ?? [], null); $this->setIfExists('country_is_not', $data ?? [], null); @@ -805,6 +826,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets country * diff --git a/src/Model/V2RuleAuthAction.php b/src/Model/V2RuleAuthAction.php index 1b251a4a..9665b2dc 100644 --- a/src/Model/V2RuleAuthAction.php +++ b/src/Model/V2RuleAuthAction.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2RuleAuthRequest.php b/src/Model/V2RuleAuthRequest.php index 485a8fba..e23e713a 100644 --- a/src/Model/V2RuleAuthRequest.php +++ b/src/Model/V2RuleAuthRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -72,6 +72,9 @@ class V2RuleAuthRequest implements ModelInterface, ArrayAccess, \JsonSerializabl 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'auth_user' => 'string', 'auth_pass' => 'string' ]; @@ -99,6 +102,9 @@ class V2RuleAuthRequest implements ModelInterface, ArrayAccess, \JsonSerializabl 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'auth_user' => null, 'auth_pass' => null ]; @@ -124,6 +130,9 @@ class V2RuleAuthRequest implements ModelInterface, ArrayAccess, \JsonSerializabl 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'auth_user' => false, 'auth_pass' => false ]; @@ -229,6 +238,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'auth_user' => 'auth_user', 'auth_pass' => 'auth_pass' ]; @@ -254,6 +266,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'auth_user' => 'setAuthUser', 'auth_pass' => 'setAuthPass' ]; @@ -279,6 +294,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'auth_user' => 'getAuthUser', 'auth_pass' => 'getAuthPass' ]; @@ -355,6 +373,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('auth_user', $data ?? [], null); $this->setIfExists('auth_pass', $data ?? [], null); } @@ -818,6 +839,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets auth_user * diff --git a/src/Model/V2RuleBotChallenge.php b/src/Model/V2RuleBotChallenge.php index 55b5ab45..984bef99 100644 --- a/src/Model/V2RuleBotChallenge.php +++ b/src/Model/V2RuleBotChallenge.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -71,6 +71,9 @@ class V2RuleBotChallenge implements ModelInterface, ArrayAccess, \JsonSerializab 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'country' => 'string', 'country_is' => 'string[]', 'country_is_not' => 'string[]', @@ -100,6 +103,9 @@ class V2RuleBotChallenge implements ModelInterface, ArrayAccess, \JsonSerializab 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'country' => null, 'country_is' => null, 'country_is_not' => null, @@ -127,6 +133,9 @@ class V2RuleBotChallenge implements ModelInterface, ArrayAccess, \JsonSerializab 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'country' => false, 'country_is' => false, 'country_is_not' => false, @@ -234,6 +243,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'country' => 'country', 'country_is' => 'country_is', 'country_is_not' => 'country_is_not', @@ -261,6 +273,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'country' => 'setCountry', 'country_is' => 'setCountryIs', 'country_is_not' => 'setCountryIsNot', @@ -288,6 +303,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'country' => 'getCountry', 'country_is' => 'getCountryIs', 'country_is_not' => 'getCountryIsNot', @@ -366,6 +384,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('country', $data ?? [], null); $this->setIfExists('country_is', $data ?? [], null); $this->setIfExists('country_is_not', $data ?? [], null); @@ -805,6 +826,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets country * diff --git a/src/Model/V2RuleBotChallengeAction.php b/src/Model/V2RuleBotChallengeAction.php index 15f2e980..35faf0e4 100644 --- a/src/Model/V2RuleBotChallengeAction.php +++ b/src/Model/V2RuleBotChallengeAction.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2RuleBotChallengeRequest.php b/src/Model/V2RuleBotChallengeRequest.php index 714f1c28..ba0f898f 100644 --- a/src/Model/V2RuleBotChallengeRequest.php +++ b/src/Model/V2RuleBotChallengeRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -72,6 +72,9 @@ class V2RuleBotChallengeRequest implements ModelInterface, ArrayAccess, \JsonSer 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'robot_challenge_type' => 'string', 'robot_challenge_verification_ttl' => 'int', 'robot_challenge_challenge_ttl' => 'int' @@ -100,6 +103,9 @@ class V2RuleBotChallengeRequest implements ModelInterface, ArrayAccess, \JsonSer 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'robot_challenge_type' => null, 'robot_challenge_verification_ttl' => null, 'robot_challenge_challenge_ttl' => null @@ -126,6 +132,9 @@ class V2RuleBotChallengeRequest implements ModelInterface, ArrayAccess, \JsonSer 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'robot_challenge_type' => false, 'robot_challenge_verification_ttl' => false, 'robot_challenge_challenge_ttl' => false @@ -232,6 +241,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'robot_challenge_type' => 'robot_challenge_type', 'robot_challenge_verification_ttl' => 'robot_challenge_verification_ttl', 'robot_challenge_challenge_ttl' => 'robot_challenge_challenge_ttl' @@ -258,6 +270,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'robot_challenge_type' => 'setRobotChallengeType', 'robot_challenge_verification_ttl' => 'setRobotChallengeVerificationTtl', 'robot_challenge_challenge_ttl' => 'setRobotChallengeChallengeTtl' @@ -284,6 +299,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'robot_challenge_type' => 'getRobotChallengeType', 'robot_challenge_verification_ttl' => 'getRobotChallengeVerificationTtl', 'robot_challenge_challenge_ttl' => 'getRobotChallengeChallengeTtl' @@ -361,6 +379,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('robot_challenge_type', $data ?? [], null); $this->setIfExists('robot_challenge_verification_ttl', $data ?? [], 10800); $this->setIfExists('robot_challenge_challenge_ttl', $data ?? [], 30); @@ -822,6 +843,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets robot_challenge_type * diff --git a/src/Model/V2RuleContentFilter.php b/src/Model/V2RuleContentFilter.php index b96918a4..83442a36 100644 --- a/src/Model/V2RuleContentFilter.php +++ b/src/Model/V2RuleContentFilter.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -71,6 +71,9 @@ class V2RuleContentFilter implements ModelInterface, ArrayAccess, \JsonSerializa 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'country' => 'string', 'country_is' => 'string[]', 'country_is_not' => 'string[]', @@ -100,6 +103,9 @@ class V2RuleContentFilter implements ModelInterface, ArrayAccess, \JsonSerializa 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'country' => null, 'country_is' => null, 'country_is_not' => null, @@ -127,6 +133,9 @@ class V2RuleContentFilter implements ModelInterface, ArrayAccess, \JsonSerializa 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'country' => false, 'country_is' => false, 'country_is_not' => false, @@ -234,6 +243,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'country' => 'country', 'country_is' => 'country_is', 'country_is_not' => 'country_is_not', @@ -261,6 +273,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'country' => 'setCountry', 'country_is' => 'setCountryIs', 'country_is_not' => 'setCountryIsNot', @@ -288,6 +303,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'country' => 'getCountry', 'country_is' => 'getCountryIs', 'country_is_not' => 'getCountryIsNot', @@ -366,6 +384,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('country', $data ?? [], null); $this->setIfExists('country_is', $data ?? [], null); $this->setIfExists('country_is_not', $data ?? [], null); @@ -805,6 +826,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets country * diff --git a/src/Model/V2RuleContentFilterAction.php b/src/Model/V2RuleContentFilterAction.php index 5b084fb6..d56e1c08 100644 --- a/src/Model/V2RuleContentFilterAction.php +++ b/src/Model/V2RuleContentFilterAction.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2RuleContentFilterRequest.php b/src/Model/V2RuleContentFilterRequest.php index 66113e05..872d4841 100644 --- a/src/Model/V2RuleContentFilterRequest.php +++ b/src/Model/V2RuleContentFilterRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -72,6 +72,9 @@ class V2RuleContentFilterRequest implements ModelInterface, ArrayAccess, \JsonSe 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'fn_uuid' => 'string' ]; @@ -98,6 +101,9 @@ class V2RuleContentFilterRequest implements ModelInterface, ArrayAccess, \JsonSe 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'fn_uuid' => null ]; @@ -122,6 +128,9 @@ class V2RuleContentFilterRequest implements ModelInterface, ArrayAccess, \JsonSe 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'fn_uuid' => false ]; @@ -226,6 +235,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'fn_uuid' => 'fn_uuid' ]; @@ -250,6 +262,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'fn_uuid' => 'setFnUuid' ]; @@ -274,6 +289,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'fn_uuid' => 'getFnUuid' ]; @@ -349,6 +367,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('fn_uuid', $data ?? [], null); } @@ -808,6 +829,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets fn_uuid * diff --git a/src/Model/V2RuleCustomResponse.php b/src/Model/V2RuleCustomResponse.php index d0a75e52..2a171e4e 100644 --- a/src/Model/V2RuleCustomResponse.php +++ b/src/Model/V2RuleCustomResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -71,6 +71,9 @@ class V2RuleCustomResponse implements ModelInterface, ArrayAccess, \JsonSerializ 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'country' => 'string', 'country_is' => 'string[]', 'country_is_not' => 'string[]', @@ -100,6 +103,9 @@ class V2RuleCustomResponse implements ModelInterface, ArrayAccess, \JsonSerializ 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'country' => null, 'country_is' => null, 'country_is_not' => null, @@ -127,6 +133,9 @@ class V2RuleCustomResponse implements ModelInterface, ArrayAccess, \JsonSerializ 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'country' => false, 'country_is' => false, 'country_is_not' => false, @@ -234,6 +243,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'country' => 'country', 'country_is' => 'country_is', 'country_is_not' => 'country_is_not', @@ -261,6 +273,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'country' => 'setCountry', 'country_is' => 'setCountryIs', 'country_is_not' => 'setCountryIsNot', @@ -288,6 +303,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'country' => 'getCountry', 'country_is' => 'getCountryIs', 'country_is_not' => 'getCountryIsNot', @@ -366,6 +384,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('country', $data ?? [], null); $this->setIfExists('country_is', $data ?? [], null); $this->setIfExists('country_is_not', $data ?? [], null); @@ -802,6 +823,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets country * diff --git a/src/Model/V2RuleCustomResponseAction.php b/src/Model/V2RuleCustomResponseAction.php index e7458742..36861f1f 100644 --- a/src/Model/V2RuleCustomResponseAction.php +++ b/src/Model/V2RuleCustomResponseAction.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2RuleCustomResponseRequest.php b/src/Model/V2RuleCustomResponseRequest.php index e7e6ba06..6e996036 100644 --- a/src/Model/V2RuleCustomResponseRequest.php +++ b/src/Model/V2RuleCustomResponseRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -72,6 +72,9 @@ class V2RuleCustomResponseRequest implements ModelInterface, ArrayAccess, \JsonS 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'custom_response_body' => 'string', 'custom_response_status_code' => 'int', 'status_code' => 'int', @@ -101,6 +104,9 @@ class V2RuleCustomResponseRequest implements ModelInterface, ArrayAccess, \JsonS 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'custom_response_body' => null, 'custom_response_status_code' => null, 'status_code' => null, @@ -128,6 +134,9 @@ class V2RuleCustomResponseRequest implements ModelInterface, ArrayAccess, \JsonS 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'custom_response_body' => false, 'custom_response_status_code' => false, 'status_code' => false, @@ -235,6 +244,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'custom_response_body' => 'custom_response_body', 'custom_response_status_code' => 'custom_response_status_code', 'status_code' => 'status_code', @@ -262,6 +274,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'custom_response_body' => 'setCustomResponseBody', 'custom_response_status_code' => 'setCustomResponseStatusCode', 'status_code' => 'setStatusCode', @@ -289,6 +304,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'custom_response_body' => 'getCustomResponseBody', 'custom_response_status_code' => 'getCustomResponseStatusCode', 'status_code' => 'getStatusCode', @@ -367,6 +385,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('custom_response_body', $data ?? [], null); $this->setIfExists('custom_response_status_code', $data ?? [], 200); $this->setIfExists('status_code', $data ?? [], null); @@ -829,6 +850,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets custom_response_body * diff --git a/src/Model/V2RuleFunction.php b/src/Model/V2RuleFunction.php index 583fc5f4..676bb340 100644 --- a/src/Model/V2RuleFunction.php +++ b/src/Model/V2RuleFunction.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -71,6 +71,9 @@ class V2RuleFunction implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'country' => 'string', 'country_is' => 'string[]', 'country_is_not' => 'string[]', @@ -100,6 +103,9 @@ class V2RuleFunction implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'country' => null, 'country_is' => null, 'country_is_not' => null, @@ -127,6 +133,9 @@ class V2RuleFunction implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'country' => false, 'country_is' => false, 'country_is_not' => false, @@ -234,6 +243,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'country' => 'country', 'country_is' => 'country_is', 'country_is_not' => 'country_is_not', @@ -261,6 +273,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'country' => 'setCountry', 'country_is' => 'setCountryIs', 'country_is_not' => 'setCountryIsNot', @@ -288,6 +303,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'country' => 'getCountry', 'country_is' => 'getCountryIs', 'country_is_not' => 'getCountryIsNot', @@ -366,6 +384,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('country', $data ?? [], null); $this->setIfExists('country_is', $data ?? [], null); $this->setIfExists('country_is_not', $data ?? [], null); @@ -805,6 +826,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets country * diff --git a/src/Model/V2RuleFunctionAction.php b/src/Model/V2RuleFunctionAction.php index ba292caa..055a1169 100644 --- a/src/Model/V2RuleFunctionAction.php +++ b/src/Model/V2RuleFunctionAction.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2RuleFunctionRequest.php b/src/Model/V2RuleFunctionRequest.php index 28b30ac4..3994f994 100644 --- a/src/Model/V2RuleFunctionRequest.php +++ b/src/Model/V2RuleFunctionRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -72,6 +72,9 @@ class V2RuleFunctionRequest implements ModelInterface, ArrayAccess, \JsonSeriali 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'fn_uuid' => 'string' ]; @@ -98,6 +101,9 @@ class V2RuleFunctionRequest implements ModelInterface, ArrayAccess, \JsonSeriali 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'fn_uuid' => null ]; @@ -122,6 +128,9 @@ class V2RuleFunctionRequest implements ModelInterface, ArrayAccess, \JsonSeriali 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'fn_uuid' => false ]; @@ -226,6 +235,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'fn_uuid' => 'fn_uuid' ]; @@ -250,6 +262,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'fn_uuid' => 'setFnUuid' ]; @@ -274,6 +289,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'fn_uuid' => 'getFnUuid' ]; @@ -349,6 +367,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('fn_uuid', $data ?? [], null); } @@ -808,6 +829,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets fn_uuid * diff --git a/src/Model/V2RuleHeader.php b/src/Model/V2RuleHeader.php index e6af3ae6..9374b0f7 100644 --- a/src/Model/V2RuleHeader.php +++ b/src/Model/V2RuleHeader.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -71,6 +71,9 @@ class V2RuleHeader implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'country' => 'string', 'country_is' => 'string[]', 'country_is_not' => 'string[]', @@ -100,6 +103,9 @@ class V2RuleHeader implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'country' => null, 'country_is' => null, 'country_is_not' => null, @@ -127,6 +133,9 @@ class V2RuleHeader implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'country' => false, 'country_is' => false, 'country_is_not' => false, @@ -234,6 +243,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'country' => 'country', 'country_is' => 'country_is', 'country_is_not' => 'country_is_not', @@ -261,6 +273,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'country' => 'setCountry', 'country_is' => 'setCountryIs', 'country_is_not' => 'setCountryIsNot', @@ -288,6 +303,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'country' => 'getCountry', 'country_is' => 'getCountryIs', 'country_is_not' => 'getCountryIsNot', @@ -366,6 +384,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('country', $data ?? [], null); $this->setIfExists('country_is', $data ?? [], null); $this->setIfExists('country_is_not', $data ?? [], null); @@ -805,6 +826,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets country * diff --git a/src/Model/V2RuleHeaderAction.php b/src/Model/V2RuleHeaderAction.php index d29f50d4..2b1d30cc 100644 --- a/src/Model/V2RuleHeaderAction.php +++ b/src/Model/V2RuleHeaderAction.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2RuleHeaderRequest.php b/src/Model/V2RuleHeaderRequest.php index 0b4032ed..83cb4273 100644 --- a/src/Model/V2RuleHeaderRequest.php +++ b/src/Model/V2RuleHeaderRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -72,6 +72,9 @@ class V2RuleHeaderRequest implements ModelInterface, ArrayAccess, \JsonSerializa 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'headers' => 'array' ]; @@ -98,6 +101,9 @@ class V2RuleHeaderRequest implements ModelInterface, ArrayAccess, \JsonSerializa 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'headers' => null ]; @@ -122,6 +128,9 @@ class V2RuleHeaderRequest implements ModelInterface, ArrayAccess, \JsonSerializa 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'headers' => false ]; @@ -226,6 +235,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'headers' => 'headers' ]; @@ -250,6 +262,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'headers' => 'setHeaders' ]; @@ -274,6 +289,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'headers' => 'getHeaders' ]; @@ -349,6 +367,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('headers', $data ?? [], null); } @@ -808,6 +829,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets headers * diff --git a/src/Model/V2RuleProxy.php b/src/Model/V2RuleProxy.php index 762982e8..5fb9afdf 100644 --- a/src/Model/V2RuleProxy.php +++ b/src/Model/V2RuleProxy.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -71,6 +71,9 @@ class V2RuleProxy implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'country' => 'string', 'country_is' => 'string[]', 'country_is_not' => 'string[]', @@ -100,6 +103,9 @@ class V2RuleProxy implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'country' => null, 'country_is' => null, 'country_is_not' => null, @@ -127,6 +133,9 @@ class V2RuleProxy implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'country' => false, 'country_is' => false, 'country_is_not' => false, @@ -234,6 +243,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'country' => 'country', 'country_is' => 'country_is', 'country_is_not' => 'country_is_not', @@ -261,6 +273,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'country' => 'setCountry', 'country_is' => 'setCountryIs', 'country_is_not' => 'setCountryIsNot', @@ -288,6 +303,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'country' => 'getCountry', 'country_is' => 'getCountryIs', 'country_is_not' => 'getCountryIsNot', @@ -366,6 +384,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('country', $data ?? [], null); $this->setIfExists('country_is', $data ?? [], null); $this->setIfExists('country_is_not', $data ?? [], null); @@ -805,6 +826,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets country * diff --git a/src/Model/V2RuleProxyAction.php b/src/Model/V2RuleProxyAction.php index e8f64fc7..cec709fa 100644 --- a/src/Model/V2RuleProxyAction.php +++ b/src/Model/V2RuleProxyAction.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2RuleProxyActionNotifyConfig.php b/src/Model/V2RuleProxyActionNotifyConfig.php index dfd00aeb..1e0e9c7b 100644 --- a/src/Model/V2RuleProxyActionNotifyConfig.php +++ b/src/Model/V2RuleProxyActionNotifyConfig.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2RuleProxyActionQuantCloudSelection.php b/src/Model/V2RuleProxyActionQuantCloudSelection.php index b83d7fec..af476be6 100644 --- a/src/Model/V2RuleProxyActionQuantCloudSelection.php +++ b/src/Model/V2RuleProxyActionQuantCloudSelection.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2RuleProxyRequest.php b/src/Model/V2RuleProxyRequest.php index ab82b372..702d5344 100644 --- a/src/Model/V2RuleProxyRequest.php +++ b/src/Model/V2RuleProxyRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -72,6 +72,9 @@ class V2RuleProxyRequest implements ModelInterface, ArrayAccess, \JsonSerializab 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'to' => 'string', 'host' => 'string', 'auth_user' => 'string', @@ -122,6 +125,9 @@ class V2RuleProxyRequest implements ModelInterface, ArrayAccess, \JsonSerializab 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'to' => null, 'host' => null, 'auth_user' => null, @@ -170,6 +176,9 @@ class V2RuleProxyRequest implements ModelInterface, ArrayAccess, \JsonSerializab 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'to' => false, 'host' => false, 'auth_user' => false, @@ -298,6 +307,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'to' => 'to', 'host' => 'host', 'auth_user' => 'auth_user', @@ -346,6 +358,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'to' => 'setTo', 'host' => 'setHost', 'auth_user' => 'setAuthUser', @@ -394,6 +409,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'to' => 'getTo', 'host' => 'getHost', 'auth_user' => 'getAuthUser', @@ -493,6 +511,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('to', $data ?? [], null); $this->setIfExists('host', $data ?? [], null); $this->setIfExists('auth_user', $data ?? [], ''); @@ -976,6 +997,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets to * diff --git a/src/Model/V2RuleRedirect.php b/src/Model/V2RuleRedirect.php index 99fe93a5..bb07869a 100644 --- a/src/Model/V2RuleRedirect.php +++ b/src/Model/V2RuleRedirect.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -71,6 +71,9 @@ class V2RuleRedirect implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'country' => 'string', 'country_is' => 'string[]', 'country_is_not' => 'string[]', @@ -100,6 +103,9 @@ class V2RuleRedirect implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'country' => null, 'country_is' => null, 'country_is_not' => null, @@ -127,6 +133,9 @@ class V2RuleRedirect implements ModelInterface, ArrayAccess, \JsonSerializable 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'country' => false, 'country_is' => false, 'country_is_not' => false, @@ -234,6 +243,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'country' => 'country', 'country_is' => 'country_is', 'country_is_not' => 'country_is_not', @@ -261,6 +273,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'country' => 'setCountry', 'country_is' => 'setCountryIs', 'country_is_not' => 'setCountryIsNot', @@ -288,6 +303,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'country' => 'getCountry', 'country_is' => 'getCountryIs', 'country_is_not' => 'getCountryIsNot', @@ -366,6 +384,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('country', $data ?? [], null); $this->setIfExists('country_is', $data ?? [], null); $this->setIfExists('country_is_not', $data ?? [], null); @@ -802,6 +823,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets country * diff --git a/src/Model/V2RuleRedirectAction.php b/src/Model/V2RuleRedirectAction.php index 897c6016..706fce87 100644 --- a/src/Model/V2RuleRedirectAction.php +++ b/src/Model/V2RuleRedirectAction.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2RuleRedirectRequest.php b/src/Model/V2RuleRedirectRequest.php index f272510c..3dbaed42 100644 --- a/src/Model/V2RuleRedirectRequest.php +++ b/src/Model/V2RuleRedirectRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -72,6 +72,9 @@ class V2RuleRedirectRequest implements ModelInterface, ArrayAccess, \JsonSeriali 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'redirect_to' => 'string', 'redirect_code' => 'string' ]; @@ -99,6 +102,9 @@ class V2RuleRedirectRequest implements ModelInterface, ArrayAccess, \JsonSeriali 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'redirect_to' => null, 'redirect_code' => null ]; @@ -124,6 +130,9 @@ class V2RuleRedirectRequest implements ModelInterface, ArrayAccess, \JsonSeriali 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'redirect_to' => false, 'redirect_code' => false ]; @@ -229,6 +238,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'redirect_to' => 'redirect_to', 'redirect_code' => 'redirect_code' ]; @@ -254,6 +266,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'redirect_to' => 'setRedirectTo', 'redirect_code' => 'setRedirectCode' ]; @@ -279,6 +294,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'redirect_to' => 'getRedirectTo', 'redirect_code' => 'getRedirectCode' ]; @@ -355,6 +373,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('redirect_to', $data ?? [], null); $this->setIfExists('redirect_code', $data ?? [], '301'); } @@ -815,6 +836,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets redirect_to * diff --git a/src/Model/V2RuleRequest.php b/src/Model/V2RuleRequest.php index 9aa123fa..91e4ae39 100644 --- a/src/Model/V2RuleRequest.php +++ b/src/Model/V2RuleRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -71,7 +71,10 @@ class V2RuleRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'method_is_not' => 'string[]', 'ip' => 'string', 'ip_is' => 'string[]', - 'ip_is_not' => 'string[]' + 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]' ]; /** @@ -96,7 +99,10 @@ class V2RuleRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'method_is_not' => null, 'ip' => null, 'ip_is' => null, - 'ip_is_not' => null + 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null ]; /** @@ -119,7 +125,10 @@ class V2RuleRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'method_is_not' => false, 'ip' => false, 'ip_is' => false, - 'ip_is_not' => false + 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false ]; /** @@ -222,7 +231,10 @@ public function isNullableSetToNull(string $property): bool 'method_is_not' => 'method_is_not', 'ip' => 'ip', 'ip_is' => 'ip_is', - 'ip_is_not' => 'ip_is_not' + 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not' ]; /** @@ -245,7 +257,10 @@ public function isNullableSetToNull(string $property): bool 'method_is_not' => 'setMethodIsNot', 'ip' => 'setIp', 'ip_is' => 'setIpIs', - 'ip_is_not' => 'setIpIsNot' + 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot' ]; /** @@ -268,7 +283,10 @@ public function isNullableSetToNull(string $property): bool 'method_is_not' => 'getMethodIsNot', 'ip' => 'getIp', 'ip_is' => 'getIpIs', - 'ip_is_not' => 'getIpIsNot' + 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot' ]; /** @@ -343,6 +361,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); } /** @@ -797,6 +818,87 @@ public function setIpIsNot($ip_is_not) return $this; } + + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/V2RuleServeStatic.php b/src/Model/V2RuleServeStatic.php index a4b31c15..20d1a15a 100644 --- a/src/Model/V2RuleServeStatic.php +++ b/src/Model/V2RuleServeStatic.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -71,6 +71,9 @@ class V2RuleServeStatic implements ModelInterface, ArrayAccess, \JsonSerializabl 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'country' => 'string', 'country_is' => 'string[]', 'country_is_not' => 'string[]', @@ -100,6 +103,9 @@ class V2RuleServeStatic implements ModelInterface, ArrayAccess, \JsonSerializabl 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'country' => null, 'country_is' => null, 'country_is_not' => null, @@ -127,6 +133,9 @@ class V2RuleServeStatic implements ModelInterface, ArrayAccess, \JsonSerializabl 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'country' => false, 'country_is' => false, 'country_is_not' => false, @@ -234,6 +243,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'country' => 'country', 'country_is' => 'country_is', 'country_is_not' => 'country_is_not', @@ -261,6 +273,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'country' => 'setCountry', 'country_is' => 'setCountryIs', 'country_is_not' => 'setCountryIsNot', @@ -288,6 +303,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'country' => 'getCountry', 'country_is' => 'getCountryIs', 'country_is_not' => 'getCountryIsNot', @@ -366,6 +384,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('country', $data ?? [], null); $this->setIfExists('country_is', $data ?? [], null); $this->setIfExists('country_is_not', $data ?? [], null); @@ -805,6 +826,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets country * diff --git a/src/Model/V2RuleServeStaticAction.php b/src/Model/V2RuleServeStaticAction.php index 7385cd3a..4a5daa09 100644 --- a/src/Model/V2RuleServeStaticAction.php +++ b/src/Model/V2RuleServeStaticAction.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2RuleServeStaticRequest.php b/src/Model/V2RuleServeStaticRequest.php index 7d1936c8..68d5c044 100644 --- a/src/Model/V2RuleServeStaticRequest.php +++ b/src/Model/V2RuleServeStaticRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ @@ -72,6 +72,9 @@ class V2RuleServeStaticRequest implements ModelInterface, ArrayAccess, \JsonSeri 'ip' => 'string', 'ip_is' => 'string[]', 'ip_is_not' => 'string[]', + 'asn' => 'string', + 'asn_is' => 'string[]', + 'asn_is_not' => 'string[]', 'static_file_path' => 'string' ]; @@ -98,6 +101,9 @@ class V2RuleServeStaticRequest implements ModelInterface, ArrayAccess, \JsonSeri 'ip' => null, 'ip_is' => null, 'ip_is_not' => null, + 'asn' => null, + 'asn_is' => null, + 'asn_is_not' => null, 'static_file_path' => null ]; @@ -122,6 +128,9 @@ class V2RuleServeStaticRequest implements ModelInterface, ArrayAccess, \JsonSeri 'ip' => false, 'ip_is' => false, 'ip_is_not' => false, + 'asn' => false, + 'asn_is' => false, + 'asn_is_not' => false, 'static_file_path' => false ]; @@ -226,6 +235,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'ip', 'ip_is' => 'ip_is', 'ip_is_not' => 'ip_is_not', + 'asn' => 'asn', + 'asn_is' => 'asn_is', + 'asn_is_not' => 'asn_is_not', 'static_file_path' => 'static_file_path' ]; @@ -250,6 +262,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'setIp', 'ip_is' => 'setIpIs', 'ip_is_not' => 'setIpIsNot', + 'asn' => 'setAsn', + 'asn_is' => 'setAsnIs', + 'asn_is_not' => 'setAsnIsNot', 'static_file_path' => 'setStaticFilePath' ]; @@ -274,6 +289,9 @@ public function isNullableSetToNull(string $property): bool 'ip' => 'getIp', 'ip_is' => 'getIpIs', 'ip_is_not' => 'getIpIsNot', + 'asn' => 'getAsn', + 'asn_is' => 'getAsnIs', + 'asn_is_not' => 'getAsnIsNot', 'static_file_path' => 'getStaticFilePath' ]; @@ -349,6 +367,9 @@ public function __construct(?array $data = null) $this->setIfExists('ip', $data ?? [], null); $this->setIfExists('ip_is', $data ?? [], null); $this->setIfExists('ip_is_not', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('asn_is', $data ?? [], null); + $this->setIfExists('asn_is_not', $data ?? [], null); $this->setIfExists('static_file_path', $data ?? [], null); } @@ -808,6 +829,87 @@ public function setIpIsNot($ip_is_not) return $this; } + /** + * Gets asn + * + * @return string|null + */ + public function getAsn() + { + return $this->container['asn']; + } + + /** + * Sets asn + * + * @param string|null $asn ASN filter type (asn_is, asn_is_not, any) + * + * @return self + */ + public function setAsn($asn) + { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } + $this->container['asn'] = $asn; + + return $this; + } + + /** + * Gets asn_is + * + * @return string[]|null + */ + public function getAsnIs() + { + return $this->container['asn_is']; + } + + /** + * Sets asn_is + * + * @param string[]|null $asn_is Allowed AS numbers + * + * @return self + */ + public function setAsnIs($asn_is) + { + if (is_null($asn_is)) { + throw new \InvalidArgumentException('non-nullable asn_is cannot be null'); + } + $this->container['asn_is'] = $asn_is; + + return $this; + } + + /** + * Gets asn_is_not + * + * @return string[]|null + */ + public function getAsnIsNot() + { + return $this->container['asn_is_not']; + } + + /** + * Sets asn_is_not + * + * @param string[]|null $asn_is_not Excluded AS numbers + * + * @return self + */ + public function setAsnIsNot($asn_is_not) + { + if (is_null($asn_is_not)) { + throw new \InvalidArgumentException('non-nullable asn_is_not cannot be null'); + } + $this->container['asn_is_not'] = $asn_is_not; + + return $this; + } + /** * Gets static_file_path * diff --git a/src/Model/V2SecretStore.php b/src/Model/V2SecretStore.php index adeb1ac3..d7c93803 100644 --- a/src/Model/V2SecretStore.php +++ b/src/Model/V2SecretStore.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2SecretStoreRequest.php b/src/Model/V2SecretStoreRequest.php index d342e02a..8abcdf86 100644 --- a/src/Model/V2SecretStoreRequest.php +++ b/src/Model/V2SecretStoreRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2Store.php b/src/Model/V2Store.php index 78fb5774..db34b90a 100644 --- a/src/Model/V2Store.php +++ b/src/Model/V2Store.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2StoreItem.php b/src/Model/V2StoreItem.php index 85628fda..7c929143 100644 --- a/src/Model/V2StoreItem.php +++ b/src/Model/V2StoreItem.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2StoreItemRequest.php b/src/Model/V2StoreItemRequest.php index 46d4a746..f5583d76 100644 --- a/src/Model/V2StoreItemRequest.php +++ b/src/Model/V2StoreItemRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2StoreItemUpdateRequest.php b/src/Model/V2StoreItemUpdateRequest.php index bb23010b..2ad94a2b 100644 --- a/src/Model/V2StoreItemUpdateRequest.php +++ b/src/Model/V2StoreItemUpdateRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2StoreItemsListResponse.php b/src/Model/V2StoreItemsListResponse.php index 18c112f5..e8ef25af 100644 --- a/src/Model/V2StoreItemsListResponse.php +++ b/src/Model/V2StoreItemsListResponse.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/V2StoreRequest.php b/src/Model/V2StoreRequest.php index 4a0d6177..1d5a54ef 100644 --- a/src/Model/V2StoreRequest.php +++ b/src/Model/V2StoreRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ValidateCompose200Response.php b/src/Model/ValidateCompose200Response.php index 81f07ecb..f57f0640 100644 --- a/src/Model/ValidateCompose200Response.php +++ b/src/Model/ValidateCompose200Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ValidateCompose422Response.php b/src/Model/ValidateCompose422Response.php index 6b13b0bc..913e4f08 100644 --- a/src/Model/ValidateCompose422Response.php +++ b/src/Model/ValidateCompose422Response.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/ValidateComposeRequest.php b/src/Model/ValidateComposeRequest.php index 4dfb246e..0a9c668f 100644 --- a/src/Model/ValidateComposeRequest.php +++ b/src/Model/ValidateComposeRequest.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/Variable.php b/src/Model/Variable.php index 2bb67136..1de2528e 100644 --- a/src/Model/Variable.php +++ b/src/Model/Variable.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/Volume.php b/src/Model/Volume.php index 93bdbffb..e63834a2 100644 --- a/src/Model/Volume.php +++ b/src/Model/Volume.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/WafConfig.php b/src/Model/WafConfig.php index deabe315..4092aee6 100644 --- a/src/Model/WafConfig.php +++ b/src/Model/WafConfig.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/WafConfigBlockLists.php b/src/Model/WafConfigBlockLists.php index 45a57b0c..018eda29 100644 --- a/src/Model/WafConfigBlockLists.php +++ b/src/Model/WafConfigBlockLists.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/WafConfigHttpbl.php b/src/Model/WafConfigHttpbl.php index 298a15f5..f3b8a4c7 100644 --- a/src/Model/WafConfigHttpbl.php +++ b/src/Model/WafConfigHttpbl.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/Model/WafConfigThresholdsInner.php b/src/Model/WafConfigThresholdsInner.php index d48e1a95..4162e126 100644 --- a/src/Model/WafConfigThresholdsInner.php +++ b/src/Model/WafConfigThresholdsInner.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/src/ObjectSerializer.php b/src/ObjectSerializer.php index e2e16154..bfe3f464 100644 --- a/src/ObjectSerializer.php +++ b/src/ObjectSerializer.php @@ -15,7 +15,7 @@ * * Unified API for QuantCDN Admin and QuantCloud Platform services * - * The version of the OpenAPI document: 4.9.0 + * The version of the OpenAPI document: 4.20.0 * Generated by: https://openapi-generator.tech * Generator version: 7.13.0 */ diff --git a/test/Model/ApplicationEnvironmentsInnerTest.php b/test/Model/ApplicationEnvironmentsInnerTest.php deleted file mode 100644 index cd7dd440..00000000 --- a/test/Model/ApplicationEnvironmentsInnerTest.php +++ /dev/null @@ -1,123 +0,0 @@ -assertInstanceOf(ApplicationEnvironmentsInner::class, $model); - // Additional test implementation would go here - $this->assertTrue(true);} - - /** - * Test attribute "env_name" - */ - public function testPropertyEnvName() - { - $model = new ApplicationEnvironmentsInner(); - $this->assertInstanceOf(ApplicationEnvironmentsInner::class, $model); - // Additional test implementation would go here - $this->assertTrue(true);} - - /** - * Test attribute "status" - */ - public function testPropertyStatus() - { - $model = new ApplicationEnvironmentsInner(); - $this->assertInstanceOf(ApplicationEnvironmentsInner::class, $model); - // Additional test implementation would go here - $this->assertTrue(true);} - - /** - * Test attribute "running_count" - */ - public function testPropertyRunningCount() - { - $model = new ApplicationEnvironmentsInner(); - $this->assertInstanceOf(ApplicationEnvironmentsInner::class, $model); - // Additional test implementation would go here - $this->assertTrue(true);} - - /** - * Test attribute "desired_count" - */ - public function testPropertyDesiredCount() - { - $model = new ApplicationEnvironmentsInner(); - $this->assertInstanceOf(ApplicationEnvironmentsInner::class, $model); - // Additional test implementation would go here - $this->assertTrue(true);} -} diff --git a/test/Model/GetAIUsageStats200ResponseByModelValueTest.php b/test/Model/GetAIUsageStats200ResponseByModelValueTest.php deleted file mode 100644 index 5a60761c..00000000 --- a/test/Model/GetAIUsageStats200ResponseByModelValueTest.php +++ /dev/null @@ -1,100 +0,0 @@ -assertInstanceOf(GetAIUsageStats200ResponseByModelValue::class, $model); - } - - /** - * Test attribute "requests" - */ - public function testPropertyRequests() - { - $model = new GetAIUsageStats200ResponseByModelValue(); - $this->assertInstanceOf(GetAIUsageStats200ResponseByModelValue::class, $model); - } - - /** - * Test attribute "tokens" - */ - public function testPropertyTokens() - { - $model = new GetAIUsageStats200ResponseByModelValue(); - $this->assertInstanceOf(GetAIUsageStats200ResponseByModelValue::class, $model); - } -} diff --git a/test/Model/GetAIUsageStats200ResponseTest.php b/test/Model/GetAIUsageStats200ResponseTest.php deleted file mode 100644 index 54edc0af..00000000 --- a/test/Model/GetAIUsageStats200ResponseTest.php +++ /dev/null @@ -1,109 +0,0 @@ -assertInstanceOf(GetAIUsageStats200Response::class, $model); - } - - /** - * Test attribute "total_requests" - */ - public function testPropertyTotalRequests() - { - $model = new GetAIUsageStats200Response(); - $this->assertInstanceOf(GetAIUsageStats200Response::class, $model); - } - - /** - * Test attribute "total_tokens" - */ - public function testPropertyTotalTokens() - { - $model = new GetAIUsageStats200Response(); - $this->assertInstanceOf(GetAIUsageStats200Response::class, $model); - } - - /** - * Test attribute "by_model" - */ - public function testPropertyByModel() - { - $model = new GetAIUsageStats200Response(); - $this->assertInstanceOf(GetAIUsageStats200Response::class, $model); - } -} diff --git a/test/Model/ScalingPolicyTest.php b/test/Model/ScalingPolicyTest.php deleted file mode 100644 index 066c6052..00000000 --- a/test/Model/ScalingPolicyTest.php +++ /dev/null @@ -1,118 +0,0 @@ -assertInstanceOf(ScalingPolicy::class, $model); - } - - /** - * Test attribute "metric" - */ - public function testPropertyMetric() - { - $model = new ScalingPolicy(); - $this->assertInstanceOf(ScalingPolicy::class, $model); - } - - /** - * Test attribute "target_value" - */ - public function testPropertyTargetValue() - { - $model = new ScalingPolicy(); - $this->assertInstanceOf(ScalingPolicy::class, $model); - } - - /** - * Test attribute "scale_in_cooldown_seconds" - */ - public function testPropertyScaleInCooldownSeconds() - { - $model = new ScalingPolicy(); - $this->assertInstanceOf(ScalingPolicy::class, $model); - } - - /** - * Test attribute "scale_out_cooldown_seconds" - */ - public function testPropertyScaleOutCooldownSeconds() - { - $model = new ScalingPolicy(); - $this->assertInstanceOf(ScalingPolicy::class, $model); - } -}